如何在独立的Java应用程序中合并JMS连接? [英] How to pool the JMS connection in a standalone Java application?

查看:118
本文介绍了如何在独立的Java应用程序中合并JMS连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在研究IBM WebSphere MQ应用程序,并且我们使用JMS API来操作消息.但是我们有一个问题,就是连接花费了太多时间,并且我们想池化JMS连接,因为它是一个独立的应用程序,所以我们没有提供JNDI或池化服务的应用程序容器.那么有解决此问题的解决方案吗?对于JDBC,我们可以使用DBCP或c3p0来归档池化数据源,在JMS中,是否有任何类似的项目可以池化JMS连接?

We are working on an IBM WebSphere MQ application, and we use JMS API to operate the message. But we have a problem that the connection takes too much time, and we want to pool the JMS connection, for it's a standalone application, we have no application container to provide JNDI or pooling service. So is there a solution to resolve this? For JDBC we can use DBCP or c3p0 to archive pooling datasource, in JMS, is there any similar project that can pool JMS connections?

推荐答案

它曾经是JMS

It used to be that the JMS MQConnectionFactory had pooling built in, but it seems that in version 7, it has been removed.

设置在WebSphere的早期版本中使用ConnectionPooling JMS的MQ类.保留此方法是为了与 较旧的MQJMS应用程序,但是,因为此连接池 功能已从版本7中删除,设置了此属性 不会有效果.

Set the use of ConnectionPooling in earlier versions of the WebSphere MQ classes for JMS. This method is retained for compatibility with older MQJMS applications, but, because this Connection Pooling functionality has been removed from version 7, setting this property will have no effect.

在没有其他任何内容的情况下,您可以使用 Apache Commons Pool .与DBCP(使用Pool)的想法相同,但适用于非JDBC对象.

In the absence of anything else, you can use Apache Commons Pool. Same idea as DBCP (which uses Pool) but for non JDBC objects.

这篇关于如何在独立的Java应用程序中合并JMS连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆