我满足以下要求:
假设我在WebLogic中配置了JMS服务器,JMS队列和连接工厂。现在,消息发送者位于同一个WebLogic实例中,并且能够成功地将消息发送到队列。如果侦听器部件位于同一WebLogic实例中,则它也可以正常工作。
现在,我的要求是,消息监听器将成为部署在 WebSphere Application Server 上的完全不同的Web应用程序的一部分。所以基本上我试图从WebLogic服务器监听WebLogic队列。我试图谷歌解决方案,并发现像"外国JMS服务器"和#34;消息桥"在WebLogic中。我从这些方面理解的是,它将传入的消息(在我的WebLogic队列中)转发到远程目标(在我的例子中是WebSphere)。然后在远程目标中,我可以部署一个配置的侦听器,就好像它正在侦听本地JMS队列一样。这种理解是否正确?在任何一种情况下,我还有其他选择吗?只要我能够从远程消息队列中读取消息,我就没有要求消息需要直接可用于我的WebSphere队列。因此,如果技术上可行,消息转发对我的需求来说有点过分。任何有关这方面的指导或建议都会非常有用。
更新
我已尝试过这两篇文章中提到的确切步骤: http://middlewaretimes.blogspot.in/2014/06/how-to-configure-weblogic-server-with.html http://ibswings.blogspot.in/2008/02/integrating-mq-broker-6-with-bea.html
由于我想使用spring JMS,我已经按照tutorial编写了发件人和收件人。但是,现在我遇到了以下异常:
org.springframework.jms.InvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'jms/WLReceiverQueue'.; nested exception is com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'jms/WLReceiverQueue'.
JMS attempted to perform an MQOPEN, but WebSphere MQ reported an error.
Use the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').
at org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:285)
at org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:496)
at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:579)
at InvoiceQueueSender.sendMesage(InvoiceQueueSender.java:23)
at InvoiceSenderServlet.service(InvoiceSenderServlet.java:17)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:844)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:280)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:254)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:136)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:346)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:243)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3432)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3402)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:57)
at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2285)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2201)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1572)
at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:255)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:311)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:263)
Caused by: com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'jms/WLReceiverQueue'.
JMS attempted to perform an MQOPEN, but WebSphere MQ reported an error.
Use the linked exception to determine the cause of this error. Check that the specified queue and queue manager are defined correctly.
at com.ibm.msg.client.wmq.common.internal.Reason.reasonToException(Reason.java:503)
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:221)
at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1061)
at com.ibm.msg.client.wmq.internal.WMQMessageProducer.checkJmqiCallSuccess(WMQMessageProducer.java:1019)
at com.ibm.msg.client.wmq.internal.WMQMessageProducer.access$800(WMQMessageProducer.java:68)
at com.ibm.msg.client.wmq.internal.WMQMessageProducer$SpiIdentifiedProducerShadow.initialise(WMQMessageProducer.java:765)
at com.ibm.msg.client.wmq.internal.WMQMessageProducer.(WMQMessageProducer.java:995)
at com.ibm.msg.client.wmq.internal.WMQSession.createProducer(WMQSession.java:886)
at com.ibm.msg.client.jms.internal.JmsSessionImpl.createProducer(JmsSessionImpl.java:1232)
at com.ibm.msg.client.jms.internal.JmsQueueSessionImpl.createSender(JmsQueueSessionImpl.java:136)
at com.ibm.mq.jms.MQQueueSession.createSender(MQQueueSession.java:153)
at com.ibm.mq.jms.MQQueueSession.createProducer(MQQueueSession.java:254)
at org.springframework.jms.core.JmsTemplate.doCreateProducer(JmsTemplate.java:1142)
at org.springframework.jms.core.JmsTemplate.createProducer(JmsTemplate.java:1123)
at org.springframework.jms.core.JmsTemplate.doSend(JmsTemplate.java:600)
at org.springframework.jms.core.JmsTemplate$4.doInJms(JmsTemplate.java:583)
at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:493)
... 21 more
Caused by: com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' ('MQCC_FAILED') reason '2085' ('MQRC_UNKNOWN_OBJECT_NAME').
at com.ibm.msg.client.wmq.common.internal.Reason.createException(Reason.java:209)