Configuring prefetch limit via Broker URI

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Configuring prefetch limit via Broker URI

hbruch
Hi,

is there a way to configure the PrefetchPolicy per connection using the broker URI? I tried to set it without success using

vm://localhost?jms.prefetchPolicy.queuePrefetch=1.

I got the following execption:

javax.jms.JMSException: Could not connect to broker URL: vm://localhos
t?jms.prefetchPolicy.queuePrefetch=1. Reason: java.lang.IllegalArgumentException: Invalid connect parameters: {jms.prefetchPolicy.queuePrefetch=1}
        at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:32)
        at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:252)
        at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:211)
        at org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:158)
        ...
Caused by: java.lang.IllegalArgumentException: Invalid connect parameters: {jms.prefetchPolicy.queuePrefetch=1}
        at org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:130)
        at org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:48)
        at org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:42)
        at org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:76)
        at org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:223)
        ... 10 more

Thanks for your help,
Holger


Reply | Threaded
Open this post in threaded view
|

Re: Configuring prefetch limit via Broker URI

James Strachan-2
I'm afraid not - but here is via the destination...

http://incubator.apache.org/activemq/destination-options.html

On 8/1/06, hbruch <[hidden email]> wrote:

>
> Hi,
>
> is there a way to configure the PrefetchPolicy per connection using the
> broker URI? I tried to set it without success using
>
> vm://localhost?jms.prefetchPolicy.queuePrefetch=1.
>
> I got the following execption:
>
> javax.jms.JMSException: Could not connect to broker URL: vm://localhos
> t?jms.prefetchPolicy.queuePrefetch=1. Reason:
> java.lang.IllegalArgumentException: Invalid connect parameters:
> {jms.prefetchPolicy.queuePrefetch=1}
>         at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:32)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:252)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:211)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:158)
>         ...
> Caused by: java.lang.IllegalArgumentException: Invalid connect parameters:
> {jms.prefetchPolicy.queuePrefetch=1}
>         at
> org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:130)
>         at
> org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:48)
>         at
> org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:42)
>         at
> org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:76)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:223)
>         ... 10 more
>
> Thanks for your help,
> Holger
>
>
>
> --
> View this message in context: http://www.nabble.com/Configuring-prefetch-limit-via-Broker-URI-tf2033127.html#a5593056
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/
Reply | Threaded
Open this post in threaded view
|

Re: Configuring prefetch limit via Broker URI

Francesco Vivoli
Hi

isn't it possible to do it through the ActiveMQConnectionFactory.brokerUrl property?

reading http://www.activemq.org/site/what-is-the-prefetch-limit-for.html
it seems so, but if I create

    <bean id="jmsConnectionFactory2" class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="vm://localhost?jms.prefetchPolicy.all=1"/>
...
    </bean>

I get an IllegalArgumentException the same...
But I can pass an instance of ActiveMQPrefetchPolicy to the connectionFactory so there's no problem,
but I don't know if there's something that I'm missing.

Cheers
Francesco



James.Strachan wrote
I'm afraid not - but here is via the destination...

http://incubator.apache.org/activemq/destination-options.html

On 8/1/06, hbruch <holger.bruch@isb-ag.de> wrote:
>
> Hi,
>
> is there a way to configure the PrefetchPolicy per connection using the
> broker URI? I tried to set it without success using
>
> vm://localhost?jms.prefetchPolicy.queuePrefetch=1.
>
> I got the following execption:
>
> javax.jms.JMSException: Could not connect to broker URL: vm://localhos
> t?jms.prefetchPolicy.queuePrefetch=1. Reason:
> java.lang.IllegalArgumentException: Invalid connect parameters:
> {jms.prefetchPolicy.queuePrefetch=1}
>         at
> org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:32)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:252)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:211)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createConnection(ActiveMQConnectionFactory.java:158)
>         ...
> Caused by: java.lang.IllegalArgumentException: Invalid connect parameters:
> {jms.prefetchPolicy.queuePrefetch=1}
>         at
> org.apache.activemq.transport.vm.VMTransportFactory.doCompositeConnect(VMTransportFactory.java:130)
>         at
> org.apache.activemq.transport.vm.VMTransportFactory.doConnect(VMTransportFactory.java:48)
>         at
> org.apache.activemq.transport.TransportFactory.doConnect(TransportFactory.java:42)
>         at
> org.apache.activemq.transport.TransportFactory.connect(TransportFactory.java:76)
>         at
> org.apache.activemq.ActiveMQConnectionFactory.createActiveMQConnection(ActiveMQConnectionFactory.java:223)
>         ... 10 more
>
> Thanks for your help,
> Holger
>
>
>
> --
> View this message in context: http://www.nabble.com/Configuring-prefetch-limit-via-Broker-URI-tf2033127.html#a5593056
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


--

James
-------
http://radio.weblogs.com/0112098/