You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Paul Mellor <pa...@gmail.com> on 2017/04/26 20:52:23 UTC

Setting client prefetch in Artemis Core API

Hi,

How do I set the client prefetch when using the Artemis Core API?  I've
seen examples of setting it in the URL when using the JMS API but couldn't
find anything that worked for the Core API.

I am creating my client consumer as so:

ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(
    new TransportConfiguration(InVMConnectorFactory.class.getName())
);

ClientSessionFactory factory = locator.createSessionFactory();
ClientSession session = factory.createSession();
session.start();

ClientConsumer consumer = session.createConsumer("queue");

Thanks in advance

Paul

Re: Setting client prefetch in Artemis Core API

Posted by Paul Mellor <pa...@gmail.com>.
Does exactly what I wanted, thanks a lot Justin.

On 26 April 2017 at 22:00, Justin Bertram <jb...@apache.org> wrote:

> I think the simplest way is to set it on the URL, e.g.:
>
>   ServerLocator locator = ActiveMQClient.createServerLocator("vm://0?
> consumerWindowSize=1024);
>
>   ClientSessionFactory factory = locator.createSessionFactory();
>   ClientSession session = factory.createSession();
>   session.start();
>
>   ClientConsumer consumer = session.createConsumer("queue");
>
>
> Justin
>
>
> ----- Original Message -----
> From: "Paul Mellor" <pa...@gmail.com>
> To: users@activemq.apache.org
> Sent: Wednesday, April 26, 2017 3:52:23 PM
> Subject: Setting client prefetch in Artemis Core API
>
> Hi,
>
> How do I set the client prefetch when using the Artemis Core API?  I've
> seen examples of setting it in the URL when using the JMS API but couldn't
> find anything that worked for the Core API.
>
> I am creating my client consumer as so:
>
> ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(
>     new TransportConfiguration(InVMConnectorFactory.class.getName())
> );
>
> ClientSessionFactory factory = locator.createSessionFactory();
> ClientSession session = factory.createSession();
> session.start();
>
> ClientConsumer consumer = session.createConsumer("queue");
>
> Thanks in advance
>
> Paul
>

Re: Setting client prefetch in Artemis Core API

Posted by Justin Bertram <jb...@apache.org>.
I think the simplest way is to set it on the URL, e.g.:

  ServerLocator locator = ActiveMQClient.createServerLocator("vm://0?consumerWindowSize=1024);

  ClientSessionFactory factory = locator.createSessionFactory();
  ClientSession session = factory.createSession();
  session.start();

  ClientConsumer consumer = session.createConsumer("queue");


Justin


----- Original Message -----
From: "Paul Mellor" <pa...@gmail.com>
To: users@activemq.apache.org
Sent: Wednesday, April 26, 2017 3:52:23 PM
Subject: Setting client prefetch in Artemis Core API

Hi,

How do I set the client prefetch when using the Artemis Core API?  I've
seen examples of setting it in the URL when using the JMS API but couldn't
find anything that worked for the Core API.

I am creating my client consumer as so:

ServerLocator locator = ActiveMQClient.createServerLocatorWithoutHA(
    new TransportConfiguration(InVMConnectorFactory.class.getName())
);

ClientSessionFactory factory = locator.createSessionFactory();
ClientSession session = factory.createSession();
session.start();

ClientConsumer consumer = session.createConsumer("queue");

Thanks in advance

Paul