- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
目前我正在使用骡子,需要在 WMQ 队列中写入。但是我不想使用 WMQ 端点,而是想通过使用 JMS 端点来实现。这是我的配置:
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:jetty="http://www.mulesoft.org/schema/mule/jetty" xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:vm="http://www.mulesoft.org/schema/mule/vm" xmlns:wmq="http://www.mulesoft.org/schema/mule/ee/wmq" xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:json="http://www.mulesoft.org/schema/mule/json" xmlns:data-mapper="http://www.mulesoft.org/schema/mule/ee/data-mapper" xmlns:ajax="http://www.mulesoft.org/schema/mule/ajax" xmlns:jersey="http://www.mulesoft.org/schema/mule/jersey" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/jersey http://www.mulesoft.org/schema/mule/jersey/current/mule-jersey.xsd
http://www.mulesoft.org/schema/mule/ajax http://www.mulesoft.org/schema/mule/ajax/current/mule-ajax.xsd
http://www.mulesoft.org/schema/mule/ee/data-mapper http://www.mulesoft.org/schema/mule/ee/data-mapper/current/mule-data-mapper.xsd
http://www.mulesoft.org/schema/mule/json http://www.mulesoft.org/schema/mule/json/current/mule-json.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd
http://www.mulesoft.org/schema/mule/ee/wmq http://www.mulesoft.org/schema/mule/ee/wmq/current/mule-wmq-ee.xsd
http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/current/mule-vm.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/jetty http://www.mulesoft.org/schema/mule/jetty/current/mule-jetty.xsd
http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/current/mule-jms.xsd">
<wmq:connector name="WMQ" hostName="localhost" port="1414" queueManager="localmanager" validateConnections="true" doc:name="WMQ" ccsId="819"/>
<data-mapper:config name="map_to_xml" transformationGraphPath="map_to_xml.grf" doc:name="map_to_xml"/>
<data-mapper:config name="xml_to_json" transformationGraphPath="xml_to_json.grf" doc:name="xml_to_json"/>
<jms:connector name="jmsConnector"
connectionFactoryJndiName="jms/ConnectionFactory"
jndiInitialFactory="com.ibm.websphere.naming.WsnInitialContextFactory"
specification="1.1"
connectionFactory-ref="MQConnectionFactory">
<spring:property name="jmsSupport" ref="customJmsSupport"/>
</jms:connector>
<spring:beans>
<spring:bean id="customJmsSupport" class="CustomJms11Support">
<spring:constructor-arg ref="jmsConnector" />
</spring:bean>
<spring:bean name="MQConnectionFactory" class="com.ibm.mq.jms.MQQueueConnectionFactory">
<spring:property name="hostName" value="localhost"/>
<spring:property name="port" value="1414"/>
<spring:property name="queueManager" value="localmanager"/>
<spring:property name="transportType" value="1"/>
</spring:bean>
</spring:beans>
<flow name="RequestFlow" doc:name="RequestFlow">
<http:inbound-endpoint exchange-pattern="request-response" host="localhost" port="8088" path="uebermittleAusweisdaten" doc:name="HTTP" contentType="text/html"/>
<expression-filter expression="#[message.payload !='/favicon.ico']" doc:name="Expression"/>
<jersey:resources doc:name="REST">
<component class="de.fraport.sources.RestClass"/>
</jersey:resources>
<set-variable variableName="id" value="#[message.id]" doc:name="Message ID"/>
<json:json-to-object-transformer returnClass="java.util.Map" doc:name="JSON to Object"/>
<data-mapper:transform config-ref="map_to_xml" doc:name="Map To XML">
<data-mapper:input-arguments>
<data-mapper:input-argument key="id">#[flowVars['id']]</data-mapper:input-argument>
</data-mapper:input-arguments>
</data-mapper:transform>
<flow-ref name="Subflow1" doc:name="Flow Reference"/>
<parse-template location="D:\Workspace\ajax_rest\src\main\app\www\index.html" doc:name="Parse Template"/>
</flow>
<sub-flow name="Subflow1" doc:name="Subflow1">
<mulexml:xslt-transformer encoding="ISO8859-1" maxIdleTransformers="2" maxActiveTransformers="5" xsl-file="D:\Workspace\ajax_rest\mobako.sender.xsl" doc:name="SOAP Envelope"/>
<mulexml:dom-to-xml-transformer outputEncoding="ISO8859-1" doc:name="DOM to XML"/>
<outbound-endpoint doc:name="JMS" address="jms://LSMH.ZKSEAP.SERVICEBUS" connector-ref="jmsConnector" encoding="ISO8859-1"/>
<!-- <wmq:outbound-endpoint queue="LSMH.ZKSEAP.SERVICEBUS" encoding="ISO8859-1" connector-ref="WMQ" doc:name="ZKSEAP IN"/> -->
<set-property propertyName="MULE_CORRELATION_ID" value="#[function:dateStamp:yyyy-MM-dd HH:mm:ss]" doc:name="Set Correlation ID"/>
<request-reply>
<vm:outbound-endpoint path="sender">
<message-properties-transformer scope="outbound">
<delete-message-property key="MULE_REPLYTO"/>
</message-properties-transformer>
</vm:outbound-endpoint>
<vm:inbound-endpoint path="response">
<logger level="INFO" message="#[string:XXXXXX 1: #[message.inboundProperties]"/>
</vm:inbound-endpoint>
</request-reply>
</sub-flow>
<flow name="ResponseFlow" doc:name="ResponseFlow">
<inbound-endpoint address="jms://ZKSEAP.LSMH.SERVICEBUS" connector-ref="jmsConnector" doc:name="ZKSEAP OUT"/>
<!-- <wmq:inbound-endpoint queue="ZKSEAP.LSMH.SERVICEBUS" connector-ref="WMQ" doc:name="ZKSEAP OUT" encoding="UTF-8"/> -->
<set-property propertyName="MULE_CORRELATION_ID" value="#[function:dateStamp:yyyy-MM-dd HH:mm:ss]" doc:name="Set Correlation ID"/>
<data-mapper:transform doc:name="XML To JSON" config-ref="xml_to_json"/>
<byte-array-to-string-transformer doc:name="Byte Array to String"/>
<vm:outbound-endpoint path="response" doc:name="Response Outbound" exchange-pattern="one-way"/>
</flow>
</mule>
2014-07-22 10:11:27,064 [Axis2 Task] ERROR WMQMsg - Expected MQ message format ' MQSTR ', but received 'MQHRF2 ' 2014-07-22 10:11:27,064 [Axis2 Task] WARN QMgrConnection - Moving msg into dead letter queue after 1 try/tries: 414D51206C6F63616C6D616E616765721A0CCE5320003C0 2 [Fatal Error] :1:1: Content ist nicht zulõssig in Prolog. ERROR: 'Content ist nicht zulõssig in Prolog.' 2014-07-22 10:11:27,064 [Axis2 Task] WARN ESBMsg - Error prettifying ESBMsg for log printing
<setHeader headerName="CamelJmsDestinationName">
<constant>queue:///LSMH.ZKSEAP.SERVICEBUS?targetClient=1</constant>
</setHeader>
最佳答案
刚刚解决了这个问题:
没错,我们需要创建一个java类来设置targetClient。为此,我们可以按照我上面提供的链接进行操作。但是,我们需要稍微更改一下代码。
这是正确的代码:
import javax.jms.Destination;
import javax.jms.JMSException;
import javax.jms.Session;
import org.mule.api.endpoint.ImmutableEndpoint;
import org.mule.transport.jms.Jms11Support;
import org.mule.transport.jms.JmsConnector;
import com.ibm.mq.jms.JMSC;
import com.ibm.mq.jms.MQQueue;
/**
* Implements WebSphere MQ specific JMS support for Mule. The class
* overrides the createDestination method to intercept JMS Queue object
* creation and sets the targetClient=1 property on created MQQueue
* objects. This is necessary to prevent non-JMS consumers from being
* choked by RFH2 headers.
*/
public class CustomJms11Support extends Jms11Support {
public CustomJms11Support(JmsConnector connector) {
super(connector);
}
@Override
public Destination createDestination(Session session, String name, boolean
topic, ImmutableEndpoint ie) throws JMSException {
Destination destination = super.createDestination(session, name, topic, ie);
if (destination instanceof MQQueue){
((MQQueue) destination).setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ);
}
return destination;
}
}
<set-property propertyName="JMS_IBM_Character_Set" value="ISO8859_1" doc:name="Property"/>
关于jms - 骡子 ESB : Setup JMS Endpoint for WMQ Queue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24882672/
我正在读这个 question和 corresponding answer并被答案第一行中的术语 JMS broker 弄糊涂了: MS (ActiveMQ is a JMS broker imple
我正在学习 API 中的 Reactive Streams,我对它与 JMS 之间的相似性感到震惊。在 JMS 中,我们也有异步处理、发布者和订阅者。我在进行这种等效时缺少什么观点? 最佳答案 Rea
假设生产者向 JMS 主题“新闻”发送一条消息。消费者 1 读取了消息,但消费者 2 处于离线状态,因此他还没有读取消息。 是否有任何内置(针对规范或实现)的方式来通知生产者消费者 1 已阅读他的消息
目前我正在开发一个 JMS 应用程序。但我使用普通的 JMS API 和属性文件进行配置。我的应用程序在 Weblogic 中运行并连接到我客户端的 MQ 系列服务器。 最近我知道我可以使用 Webl
我正在尝试使用 Solace 中可用的异步发送功能,但我打算使用 JMS 进行抽象,而不是直接使用 JCSMP 使用它。 JMS 2.0 支持异步发送以及其他新功能:http://www.oracle
我无法获得 javax.jms.ConnectionFactory注入(inject)我的独立 JMS 客户端。 我得到一个 java.lang.NullPointerException在 conne
保持 JMS 连接/ session /消费者始终打开是一种不好的做法吗? 代码草稿示例: // app startup code ConnectionFactory cf = (Connection
我有几个作业,每个作业都有多条消息排队。每个作业的消息随机交错。如果用户决定取消作业,我想从队列中删除属于该作业的所有消息。我已经能够使用 browse() 找到所有要删除的消息,但一直无法弄清楚如何
是否可以将主题配置为仅存储最后一条消息的副本并将其发送到新连接而不知道客户端标识符或其他信息? 更新: 从 Shashi 提供的信息中,我发现这两页使用 retroactive consumer 描述
目前正在使用 WebLogic 和分布式队列。我从文档中了解到,分布式队列允许您使用全局 JNDI 名称检索到集群中任何队列的连接。分布式队列为您提供的主要功能之一似乎是跨多个托管服务器的负载平衡连接
再见,我的基本要求是有一个可以发送消息的路由,并将其放在 JMS 队列中。 camel 上下文在 JavaEE 6 容器中运行,即 JBoss AS 7.1.1,因此它是 HornetQ for JM
我正在阅读 JMS 2.0 规范,其中提到(相关摘录下方)如果客户端尝试修改 Message 对象,则 JMS 提供程序可能会抛出异常。 我的问题是 JMS 提供者如何知道客户端是否试图修改 Mess
我的 spring 上下文文件中有以下设置。 "PowerEventQueue" “${
我正在尝试使用 JSP 连接到 ActiveMQ。但是,当我运行该程序时,它给了我以下类型的异常: NoClassDefFoundError: javax/jms/Destination . 我不确定
我刚看了CORBA和JMS,他们好像都是用来实现的代理架构/模式。 我对他们有几个问题 1.他们之间的区别我还不是很清楚,谁能解释一下? 2.CORBA 是否用于当今的 IT 解决方案?还是正在失去魅
我正在更新现有的 Mule 配置,任务是增强它以根据消息的某些属性将消息路由到不同的端点,因此最好对我手头的两个选项有一些利弊: 在消息上添加属性,使用“message-properties-tran
我有一个订阅 JMS 主题应用程序的 Java 应用程序,该应用程序偶尔会出现以下异常: javax.jms.JMSException: Connection has been terminated
我知道 Camel 的 JMS 组件用于接收消息,使用 Springs DefaultMessageListenerContainer。它可以配置为使用 CLIENT_ACKNOWLEDGE 模式来确
通常不鼓励使用从 JMS 提供者返回的消息 ID 作为相关 ID,将消息发布到队列中。人们如何为请求/响应架构生成相关 ID? 最佳答案 客户端可以使用唯一的 ID 标准,如 UUID生成新的 ID。
我有一个简单的代码可以将 2 条消息放入队列中。 1) 我用两台服务器设置了 connectionNameList。 2) 这两个服务器是独立的,但有相同的队列管理器和定义相同名称的队列,例如“QMg
我是一名优秀的程序员,十分优秀!