如何从 JBOSS 4 和 5 连接 JMS 队列?

发布于 2024-09-17 09:51:54 字数 202 浏览 10 评论 0原文

我有一台运行 Jboss 4.2.2 和 Jboss 5.1.0 的服务器。问题是第三方无法在不久的将来将其应用程序升级到 Jboss 5.1.0,对我们来说这是一件简单的事情。不幸的是,我们需要从 Jboss 4.2.2 上运行的第三方应用程序发送和接收一些 JMS 消息。

在 JbossMQ 和 JbossMessaging 之间传输 JMS 消息的最简单方法是什么?

I have a server on which a Jboss 4.2.2 and a Jboss 5.1.0 runs. The problem is that a 3rd party is not able to upgrade its application to Jboss 5.1.0 in the near future, for us it is a simple matter. Unfortunately we need to send and receive some JMS messages from the third party app running on Jboss 4.2.2.

What is the easiest way to enable the transfer of JMS messages between JbossMQ and JbossMessaging?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

咋地 2024-09-24 09:51:54

我想我找到了解决问题的方法。 JBOSS 文档有一章介绍在 JBOSS Messaging 和 JBOSS MQ 之间迁移消息: http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/5.0.0.BETA/html/JBoss_Messaging_User_Guide/inst-mqmessagemigration.html

我我的 JBOSS 4.2 上有 2 个主题 myTopicSend 和 myTopicReceive,JBOSS 5.1 上有 2 个主题 myTopicSend5 和 myTopicReceive5。

我想桥接从 myTopicSend 到 myTopicReceive5 以及从 myTopicSend5 到 MyTopicReceive 的所有消息。

不知何故,配置一开始根本不起作用,但经过一段时间的实验后,我现在有了以下配置:

<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=RemoteJBossMQProvider">
    <attribute name="ProviderName">RemoteXAConnectionFactory</attribute>
    <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
    <attribute name="FactoryRef">XAConnectionFactory</attribute>
    <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
    <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
    <attribute name="Properties">
        java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
        java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
        java.naming.provider.url=127.0.0.1:1099
    </attribute>
</mbean> 

<mbean code="org.jboss.jms.server.bridge.BridgeService"
       name="jboss.messaging:service=Bridge,name=LegayBridgeSend" xmbean-dd="xmdesc/Bridge-xmbean.xml">
    <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJBossMQProvider</depends>
    <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
    <attribute name="SourceDestinationLookup">/topic/myTopicSend</attribute>
    <attribute name="TargetDestinationLookup">/topic/myTopicReceive5</attribute>
    <attribute name="QualityOfServiceMode">0</attribute>
    <attribute name="MaxBatchSize">1</attribute>
    <attribute name="MaxBatchTime">-1</attribute>
    <attribute name="FailureRetryInterval">5000</attribute>
    <attribute name="MaxRetries">-1</attribute>
    <attribute name="AddMessageIDInHeader">false</attribute>
</mbean>

<mbean code="org.jboss.jms.server.bridge.BridgeService"
       name="jboss.messaging:service=Bridge,name=LegayBridgeReceive" xmbean-dd="xmdesc/Bridge-xmbean.xml">
    <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
    <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJBossMQProvider</depends>
    <attribute name="SourceDestinationLookup">/topic/myTopicSend5</attribute>
    <attribute name="TargetDestinationLookup">/topic/myTopicReceive</attribute>
    <attribute name="QualityOfServiceMode">0</attribute>
    <attribute name="MaxBatchSize">1</attribute>
    <attribute name="MaxBatchTime">-1</attribute>
    <attribute name="FailureRetryInterval">5000</attribute>
    <attribute name="MaxRetries">-1</attribute>
    <attribute name="AddMessageIDInHeader">false</attribute>
</mbean>

我意识到的一件重要的事情是,调整 MaxBatchSizeMaxBatchTime > 参数,因为我想立即将消息传递到目标队列。

这些参数的描述可以在 http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/5.0.0/html/JBoss_Messaging_1.4.6/index.html

I think I found the solution for my problem. The JBOSS documentation has a chapter to migrate messages between JBOSS Messaging and JBOSS MQ: http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/5.0.0.BETA/html/JBoss_Messaging_User_Guide/inst-mqmessagemigration.html

I have 2 topics myTopicSend and myTopicReceive on my JBOSS 4.2 and I have 2 topics myTopicSend5 and myTopicReceive5 on JBOSS 5.1.

I wanted to bridge all messages from myTopicSend to myTopicReceive5 and from myTopicSend5 to MyTopicReceive.

Somehow the configuration didn't work at all first, but after some time of experimenting I have now the following config:

<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
       name="jboss.messaging:service=JMSProviderLoader,name=RemoteJBossMQProvider">
    <attribute name="ProviderName">RemoteXAConnectionFactory</attribute>
    <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
    <attribute name="FactoryRef">XAConnectionFactory</attribute>
    <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
    <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
    <attribute name="Properties">
        java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
        java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
        java.naming.provider.url=127.0.0.1:1099
    </attribute>
</mbean> 

<mbean code="org.jboss.jms.server.bridge.BridgeService"
       name="jboss.messaging:service=Bridge,name=LegayBridgeSend" xmbean-dd="xmdesc/Bridge-xmbean.xml">
    <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJBossMQProvider</depends>
    <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
    <attribute name="SourceDestinationLookup">/topic/myTopicSend</attribute>
    <attribute name="TargetDestinationLookup">/topic/myTopicReceive5</attribute>
    <attribute name="QualityOfServiceMode">0</attribute>
    <attribute name="MaxBatchSize">1</attribute>
    <attribute name="MaxBatchTime">-1</attribute>
    <attribute name="FailureRetryInterval">5000</attribute>
    <attribute name="MaxRetries">-1</attribute>
    <attribute name="AddMessageIDInHeader">false</attribute>
</mbean>

<mbean code="org.jboss.jms.server.bridge.BridgeService"
       name="jboss.messaging:service=Bridge,name=LegayBridgeReceive" xmbean-dd="xmdesc/Bridge-xmbean.xml">
    <depends optional-attribute-name="SourceProviderLoader">jboss.messaging:service=JMSProviderLoader,name=JMSProvider</depends>
    <depends optional-attribute-name="TargetProviderLoader">jboss.messaging:service=JMSProviderLoader,name=RemoteJBossMQProvider</depends>
    <attribute name="SourceDestinationLookup">/topic/myTopicSend5</attribute>
    <attribute name="TargetDestinationLookup">/topic/myTopicReceive</attribute>
    <attribute name="QualityOfServiceMode">0</attribute>
    <attribute name="MaxBatchSize">1</attribute>
    <attribute name="MaxBatchTime">-1</attribute>
    <attribute name="FailureRetryInterval">5000</attribute>
    <attribute name="MaxRetries">-1</attribute>
    <attribute name="AddMessageIDInHeader">false</attribute>
</mbean>

A important thing I realized was, to tweak the MaxBatchSize and MaxBatchTime parameters, because I want to deliver the messages immediately to the target queue.

A description of these parameters may be found at http://www.redhat.com/docs/en-US/JBoss_Enterprise_Application_Platform/5.0.0/html/JBoss_Messaging_1.4.6/index.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文