- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我基于 Apache-camel 的应用正在使用来自 IBM 队列之一的消息,例如下面是连接工厂的详细信息
hostname=host1000
QManager=QM1000
Port="some port"
Channel="common channel"
Camel 流消费和处理并将响应发送到来自消息头的 ReplyQueue。
from(wmq:queue:<INPUT_QUEUE>)
.bean("processBean")
.bean("beanToSendMsgToReplyQueue")
在 Camel header 中,我低于 JMSReplyQueue。您可以看到它是一个不同的队列管理器,这个队列管理器来自不同的主机,但在集群环境中。
JMSReplyTo = queue://QM1012/TEST.REPLY?targetClient=1
队列管理器也介于两者之间。喜欢
queue://<queue-manager>//<queue-name>?<other parameters>
下面是我在发送消息时遇到的异常。
ERROR o.apache.camel.processor.DefaultErrorHandler:215 - Failed delivery for (MessageId: ID-xxxxxxxxx-0-4 on ExchangeId: ID-xxxxxx-42443-1492594420697-0-1). Exhausted after delivery attempt: 1 caught: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: wmq://queue://QM1012/TEST.REPLY?targetClient=1 due to: Failed to resolve endpoint: wmq://queue://TAP2001R5/TEST?targetClient=1 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{targetClient=1}]. Processed by failure processor: FatalFallbackErrorHandler[Pipeline[[Channel[sendTo(Endpoint[wmq://queue:BACKOUT_Q])], Channel[DelegateSync[com.xxx.yyy.listener.XXXOnExceptionProcessor@21c66ee4]], Channel[Stop]]]]
任何人都可以帮助我将消息发送到不同主机中的不同队列管理器队列,但它们都在同一个集群中。队列管理器名称也出现在字符串中间,那么如何解决这个问题。如果您需要更多详细信息,请告诉我。
更新-1:尝试使用相同的队列管理器且不带参数
JMSReplyTo = queue://QM1000/QUEUE_V1
我得到以下异常
org.springframework.jms.InvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'QM1000/QUEUE_V1'.; nested exception is com.ibm.msg.client.jms.DetailedInvalidDestinationException: JMSWMQ2008: Failed to open MQ queue 'QM1000/QUEUE_V1'. 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 '2189' ('MQRC_CLUSTER_RESOLUTION_ERROR').
Update-2
我可以使用普通的 javax.jms.* 和 com.ibm.mq.jms.* api 向 JMSReplyTo 发送消息,但不能通过 Apache camel。 Camel 用户/开发人员组的任何人都可以帮助我使用 camel 组件处理相同的问题。
@Override
public void process(Exchange exchange)
throws Exception {
QueueConnection m_connection = this.connectionFactory.createQueueConnection();
//m_connection.start();
boolean transacted = false;
QueueSession session = m_connection.createQueueSession(transacted, QueueSession.AUTO_ACKNOWLEDGE);
TextMessage outMessage = session.createTextMessage();
outMessage.setText(exchange.getIn().getBody());
MQQueue mq = new MQQueue(
"queue://QM1012/TEST.REPLY");
QueueSender queueSender = session.createSender((MQQueue) mq);
queueSender.send(outMessage);
/* producerTemplate.send("wmq:" + "queue://QM1012/TEST.REPLY", exchange); */
}
最佳答案
您想要与两个不同的队列管理器通信,因此您需要相应地定义两个 Camel JMS 组件实例。 Camel 无法神奇地知道 QM1000 或 QM1012 的含义以及如何访问 QM。
您首先需要两个 WMQ QM 的两个 JMS 连接工厂实例。如何获取这些取决于你的执行环境。在 JEE 服务器上,可以在配置后使用 JNDI 访问连接池。查看有关如何设置 JMS 池的应用服务器文档。如果您独立运行,请查看 Spring JMS 连接缓存或 Atomikos(如果您需要 XA 事务)。假设 QM1000 的 CF 是 sourceCF,QM1012 的 CF 是 targetCF。
现在您可以定义两个 Camel JMS 组件实例,每个 QM 一个。将连接工厂注入(inject) JMS 组件 (.setConnectionFactory(...))。假设您定义了一个 id 为“jmssource”的 Camel JMS 组件,注入(inject) sourceCF。在 JMS 组件 ID“jmstarget”中注入(inject) targetCF。如何做到这一点取决于您的环境(JEE/CDI、Spring、纯 Java)。看看 stackoverflow,有例子。
您现在可以使用以下语法在 Camel 路由上指定 Camel JMS 生产者和消费者:
.from("jmssource:INPUT_QUEUE")
...
(do some processing)
...
.to("jmstarget:QUEUE_V1")
您不能使用 Camel 的 JMS 回复逻辑(使用 JMSReplyTo header )来回复另一个队列管理器。我认为这是 JMS 标准不允许的。您需要通过发送到回复队列来明确回复。
对于设置 targetClient 选项,目标解析器可能很有用:
import org.springframework.jms.support.destination.DynamicDestinationResolver;
import org.springframework.jms.support.destination.DestinationResolver;
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Session;
import com.ibm.mq.jms.JMSC;
import com.ibm.mq.jms.MQDestination;
public class WMQDestinationResolver extends DynamicDestinationResolver implements DestinationResolver {
private int targetClient = JMSC.MQJMS_CLIENT_JMS_COMPLIANT;
public void setTargetClient(int targetClient) {
this.targetClient = targetClient;
}
public Destination resolveDestinationName(Session session, String destinationName, boolean isPubSubDomain) throws JMSException {
Destination destination = super.resolveDestinationName(session, destinationName, isPubSubDomain);
if (destination instanceof MQDestination) {
MQDestination mqDestination = (MQDestination) destination;
mqDestination.setTargetClient(targetClient);
}
return destination;
}
}
关于java - 如何将消息发送到 IBM MQ 集群中不同队列管理器和主机名中托管的不同队列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43525900/
IBM Watson 和 IBM Inforsphere BigInsights (IBM Hadoop)/Streams 之间有什么区别? Watson 带来了 BigInsights 无法提供的哪
据我所知,Rational 是一种测试工具,而 Rational Rose 是一种建模工具。 最佳答案 Rational 是一家为软件开发生命周期制作工具的公司。 Rational Rose 就是这样
我尝试将 ibm-eventstreams-dev v 0.1.1 安装到 IBM Cloud Private 中,但收到一条错误消息: 内部服务错误:图表与 Tiller v2.6.0 不兼容 最佳
我正在尝试配置连接到集群MQ的集群Websphere应用程序服务器。 但是,我所掌握的信息是两个具有不同主机名,服务器通道和队列管理器的MQ实例的详细信息,这些主机名属于同一MQ集群名称。 在Webs
我想问问你们中的一些聪明人 :) 是否可以在 IBM Connections 文件中使用目录结构。还有图书馆,但我无法通过 webdav/smdb 映射它,也许这是关于我的信息差距,但我可以安装桌面插
我一次又一次地读到 IBM i 是一个支持多种编程语言的现代系统。除了 COBOL 和 RPG 之外,我如何确定哪些可供我使用? 维基百科上提供了一份 list ,我对 C、C++、BASIC、Sma
是否可以将 IBM HTTP 服务器设置为非 IBM Websphere 应用程序服务器(Glassfish、Apache Tomcat 或其他 Java 应用程序服务器)的前端?IBM 支持吗?我试
我有一个在 IBM Bluemix 上运行的简单 JSF 应用程序,与以下 J2EE 依赖项配合良好。 javax javaee-web-api 6.
我正在查看一个 RPG 程序。有一些这样的子程序:有没有工具哪个会将其创建为一个过程,可以在单独的过程中使用? C Eval FinQty# = 0
我正在设计一个新的体系结构大数据,我的客户将其作为IBM MQ代理使用。我们曾经在大数据架构中与Kafka一起工作,因为我想它比其他选择更快,更可靠,更强大,并且因为风暴和火花流在Kafka中更容易工
我偶然发现了一些 FMTDTA,它似乎是一种查询/排序语言,早于旧 RPG 系统中的 SQL。我试图解开它的用法。 例子: 物理文件布局: ORNO S 9 0 1
除了许可之外,IBM Worklight 的企业版和消费者版之间在功能方面是否存在任何差异? 最佳答案 企业版的销售目的是在组织内使用 (B2E)。许可证是“每台设备”。消费者版旨在以 B2C 的形式
我希望使用 IBM Worklight v5.0.5 Fix pack 1 设置 Eclipse 开发环境。 我可以获得有关旧版本 Worklight 的安装链接的一些指示吗? 最佳答案 查看下面的可
是否可以保留已检索且不再位于队列中的消息历史记录(包含消息内容将是完美的)? 在应用程序中,我可以看到发送者何时尝试将消息放入队列以及接收者何时尝试拾取消息,但我想查看消息何时真正到达队列以及消息何时
我正在向远程队列发送消息,但我无法控制该队列。 我发送一个 xml 文件作为消息,但是当应用程序读取消息时,它会得到一个消息头,例如 jms_text \0\0\0lqueue:///TEST128
在什么情况下队列管理器可能会失去与集群环境中存储库的连接?我的环境中队列管理器经常失去与存储库的连接,我需要刷新集群来修复此问题并重新建立与集群中其他队列管理器的通信。 我们的集群有 100 个队列管
我们正在为助手实现 Watson 技术,以帮助某些用户。 对话有些复杂,有时需要针对某些问题做跳答,这样做的坏处是用户可以再问一遍问题,以防不明白这就是问题所在。 当想进入后续进入的节点时,该节点进行
我们有一个启用了 DevOps 交付管道的 NodeJS Cloud Foundry 应用程序。 最初,我们将管道设置为使用 Bluemix 中交付管道的 Active Deploy 扩展来部署应用程
请注意,此问题特定于“IBM DB2 for i”,即 IBM i 操作系统的 version of DB2 . 下面的屏幕截图显示了一个故意错误的 INSERT 语句,它产生了 SQL0407 的
我想使用 IBM Websphere MQ 客户端 v7.5。我正在编写独立的 JMS 客户端应用程序来发送和使用来自 IBM WebsphereMQ 服务器的消息(它在其他地方运行,但我有权发送/接
我是一名优秀的程序员,十分优秀!