Quantcast

Setting client prefetch in Artemis Core API

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Setting client prefetch in Artemis Core API

Paul Mellor
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting client prefetch in Artemis Core API

jbertram
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" <[hidden email]>
To: [hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Setting client prefetch in Artemis Core API

Paul Mellor
Does exactly what I wanted, thanks a lot Justin.

On 26 April 2017 at 22:00, Justin Bertram <[hidden email]> 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" <[hidden email]>
> To: [hidden email]
> 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
>
Loading...