Over a million developers have joined DZone.

High Performance JMS Publishing

Learn more about JMS restrictions and how to solve for these problems when building a middleware product.

· Integration Zone

Learn how API management supports better integration in Achieving Enterprise Agility with Microservices and API Management, brought to you in partnership with 3scale

I started with a problem, JMS send is synchronzied per connection(In the TIBCO EMS drivers). This extremely limits outbound throughput of JMS per JVM. If you're building a middleware product, this is an extremely important metric and needs to be tuned appropriately.

So you'd think the solution would be simple. Wire up the connection pooling connection factory from Spring? Doesn't exist... that I'm aware of.

ActiveMQ provides this implementation out of the box, but if you're not using ActiveMQ, and you're using Tibco, you're out of luck.

Now, heavyweight containers like weblogic will do this caching and pooling for you. As the industry moves away from this standard, we'll need to come up with a custom solution.

Our solution was to pool JmsTemplates(using apache commons pools) each with their own connections. Ideally you'd just pool connections, but that would require a custom JmsTemplate implementation, as when I injected a proxy object as a pool, it seemed to only wire that object up on the set and only ever use 1.

We decided against creating a growing and shrinking pool, and currently keep it to a static size. But we could implement these interfaces to gain that functionality.

Unleash the power of your APIs with future-proof API management - Create your account and start your free trial today, brought to you in partnership with 3scale.

Topics:
java ,jms ,jvm ,integration

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

SEE AN EXAMPLE
Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.
Subscribe

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}