activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ttmdev <joe.fernan...@ttmsolutions.com>
Subject Re: ActiveMQ failover url problems
Date Fri, 08 Feb 2008 20:27:00 GMT

I am using the 5.1 SNAPSHOT and this failover uri works for me.

failover://(tcp://localhost:61616?wireFormat.cacheEnabled=false&wireFormat.maxInactivityDuration=0&wireFormat.tightEncodingEnabled=true)?maxReconnectDelay=1000


Jason Rosenberg wrote:
> 
> I think the uri parsing doesn't like nested '?'s....Probably a bug?
> 
> But, if you have '?' inside the parens, then you can't use one outside the
> parens...
> 
> So, you might have:
> 
> failover:(tcp://myserver?wireFormat.maxInactivityDuration=0)&maxReconnectDelay=1000
> 
> Jason
> 
> 
> 
> ramj2ee wrote:
>> 
>> If I use failover url without wireformat parameters it is working fine
>> and reconnecting on server restart.
>> If I use failover url with wireformat parameters then it is not
>> reconnecting. 
>> Whenever I stoped the server it automatically comming out without giving
>> any exception 
>> here is my code, can any one suggest what changes I needed to make for
>> failover url to work with parameters? 
>> 
>> try
>>         {
>>             ActiveMQConnectionFactory connectionFactory = new
>> ActiveMQConnectionFactory(new URI("failover://(" +
>> ActiveMQConnection.DEFAULT_BROKER_URL
>> +"?wireFormat.cacheEnabled=false&wireFormat.maxInactivityDuration=0&wireFormat.tightEncodingEnabled=true)?maxReconnectDelay=1000"));
>>             connectionFactory.setCopyMessageOnSend(false);
>>             connectionFactory.setUseCompression(true);
>>             
>>             connection = connectionFactory.createConnection();
>>             if (clientId != null && clientId.length()>0 &&
>> !"null".equals(clientId) ) {
>>                 connection.setClientID(clientId);
>>             }
>>             connection.start();
>>             Session session = connection.createSession(true,
>> Session.AUTO_ACKNOWLEDGE);
>>             Queue queue =
>> session.createQueue("productfeed.productEvents");
>>             MessageConsumer consumer = session.createConsumer(queue);
>>             consumer.setMessageListener(new
>> ProductEventsListener(session));
>>         }
>>         catch(JMSException e)
>>         {
>>             logger.error(e, e);
>>         }
>>         catch (Exception e) {
>>                 logger.error("error is " + e, e);
>>             }
>> 
>> here I am getting message on ProductEventsListener implements
>> MessageListner on onMessage(message) method 
>> 
> 
> 


-----
Joe
www.ttmsolutions.com

-- 
View this message in context: http://www.nabble.com/ActiveMQ-failover-url-problems-tp13764784s2354p15363301.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message