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 
> 

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

Reply via email to