Apache NMS API ConnectionFactory drops parameters set on Uri

Solution Unverified - Updated -

Issue

  • After some benchmarking tests we think we might have uncovered a problem in the NMS connection API – there are parameters you can pass in on the connection URL, which the NMS ConnectionFactory class expects mixed case, which the Uri class converts to lower case.

It looks like anything enclosed in brackets is left unconverted, while anything outside of a set of brackets is converted to lower case.

Depending on the parameter you’re attempting to set, and where in the connection string it’s added, it can either be:

1) Used correctly
2) Ignored silently
3) Cause an exception on startup
4) Cause the code to not work, but without throwing an exception.

Sometimes the property is logged as being part of the Uri after it’s created, and other times it’s removed.

For instance, following Uri failed to set async in our .Net test program:

Uri("activemq:failover:(tcp://JMS02.app.local:8520?keepAlive=true&wireFormat.maxInactivityDuration=60000,tcp://JMS01.app.local:8520?keepAlive=true&wireFormat.maxInactivityDuration=60000)?transport.initialReconnectDelay=100&transport.randomize=false&transport.timeout=30000&nms.watchTopicAdvisories=false&connection.CopyMessageOnSend=false&nms.AsyncSend=true");

And this Uri failed silently in our .Net test program:

Uri("activemq:failover:(tcp://JMS02.app.local:8520?keepAlive=true&wireFormat.maxInactivityDuration=60000&transport.sendBufferSize=32768?nms.AsyncSend=true,tcp://JMS01.app.local:8520?keepAlive=true&wireFormat.maxInactivityDuration=60000&transport.sendBufferSize=32768?nms.AsyncSend=true)");

Environment

  • Apache NMS 1.6.2;
  • Red Hat JBoss A-MQ 6.x;

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content