You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by hbruch <ho...@isb-ag.de> on 2006/08/01 13:56:23 UTC

Configuring prefetch limit via Broker URI

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.


Re: Configuring prefetch limit via Broker URI

Posted by drvillo <f....@gmail.com>.
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 <ho...@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/
> 
> 

-- 
View this message in context: http://www.nabble.com/Configuring-prefetch-limit-via-Broker-URI-tf2033127.html#a7856011
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Configuring prefetch limit via Broker URI

Posted by James Strachan <ja...@gmail.com>.
I'm afraid not - but here is via the destination...

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

On 8/1/06, hbruch <ho...@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/