XMSFactoryFactory factory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
IConnectionFactory connectionProperties = factory.CreateConnectionFactory();
connectionProperties.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT_Q_MGR);
connectionProperties.SetStringProperty(XMSC.WMQ_CONNECTION_NAME_LIST, String.Format("{0}({1}),{2}({3})", element.Host1, element.Port1, element.Host2, element.Port2));
connectionProperties.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT_DEFAULT);
connectionProperties.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, element.QueueManager);
connectionProperties.SetStringProperty(XMSC.WMQ_CHANNEL, element.Channel);
connectionProperties.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
connectionProperties.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);
connectionProperties.SetBooleanProperty(XMSC.WMQ_USE_CONNECTION_POOLING, true);
try
{
using (IConnection connection = _connectionProperties.CreateConnection())
{
connection.Start();
using (ISession session = connection.CreateSession(true, AcknowledgeMode.AutoAcknowledge))
{
using (var scope = new TransactionScope(TransactionScopeOption.RequiresNew))
{
using (IDestination responseQueue = session.CreateQueue(replyToRequestQueue ? _requestQueueName : _responseQueueName))
{
using (IMessageProducer producer = session.CreateProducer(responseQueue))
{
IMessage response = session.CreateTextMessage(message);
if (!string.IsNullOrEmpty(correlationId))
{
response.JMSCorrelationID = correlationId;
}
producer.Send(response);
}
}
scope.Complete();
}
}
}
}
catch (XMSException xmse)
{
if (xmse.LinkedException != null)
{
Trace.TraceError(string.Format(MQTraceMessageFormat,
DateTime.Now,
TraceMessageType.Error,
Thread.CurrentThread.ManagedThreadId,
Thread.CurrentThread.IsThreadPoolThread ? "Threadpool " + Name : Thread.CurrentThread.Name,
null, null,
"XMSException.LinkedException on (SendTextMessage) sending message to " + this +
" / xmse.LinkedException.Message : " + xmse.LinkedException.Message +
" / xmse.Message : " + xmse.Message +
" / xmse.LinkedException.StackTrace: " + xmse.LinkedException.StackTrace,
" / xmse.StackTrace: " + xmse.StackTrace,
null));
}
else
{
Trace.TraceError(string.Format(MQTraceMessageFormat,
DateTime.Now,
TraceMessageType.Error,
Thread.CurrentThread.ManagedThreadId,
Thread.CurrentThread.IsThreadPoolThread ? "Threadpool " + Name : Thread.CurrentThread.Name,
null, null,
"XMSException on (SendTextMessage) sending message to " + this +
" / xmse.Message : " + xmse.Message +
" / xmse.StackTrace: " + xmse.StackTrace,
null));
}
}
catch (MQException mqex)
{
Trace.TraceError(string.Format(MQTraceMessageFormat,
DateTime.Now,
TraceMessageType.Error,
Thread.CurrentThread.ManagedThreadId,
Thread.CurrentThread.IsThreadPoolThread ? "Threadpool " + Name : Thread.CurrentThread.Name,
null, null,
"MQException cc on (SendTextMessage) sending message to " + this +
" Exception: " + mqex.Message +
" CompletionCode: " + mqex.CompletionCode +
" ReasonCode: " + mqex.ReasonCode +
" Stack Trace: " + mqex.StackTrace,
null));
}
catch (IOException ioex)
{
Trace.TraceError(string.Format(MQTraceMessageFormat,
DateTime.Now,
TraceMessageType.Error,
Thread.CurrentThread.ManagedThreadId,
Thread.CurrentThread.IsThreadPoolThread ? "Threadpool " + Name : Thread.CurrentThread.Name,
null, null,
"IOException ioex on (SendTextMessage) sending message to " + this +
" Exception: " + ioex.Message +
" Stack Trace: " + ioex.StackTrace,
null));
}
catch (Exception ex)
{
Trace.TraceError(string.Format(MQTraceMessageFormat,
DateTime.Now,
TraceMessageType.Error,
Thread.CurrentThread.ManagedThreadId,
Thread.CurrentThread.IsThreadPoolThread ? "Threadpool " + Name : Thread.CurrentThread.Name,
null, null,
"Exception ex on (SendTextMessage) sending message to " + this +
" Exception: " + ex.Message +
" Stack Trace: " + ex.StackTrace,
null));
}
}
renamed.exe Error: 0 : |8/15/2017 10:17:49 AM|Error|25|Threadpool XYZ|||XMSException.LinkedException on (SendTextMessage) sending message to Queue handler ABC:(In ABC.XYZ.REQUEST / Out XYZ.ABC.RESPONSE) / xmse.LinkedException.Message : 2012 / xmse.Message : Failed to send a message to destination XYZ.ABC.RESPONSE.
XMS attempted to perform an MQPUT or MQPUT1; however WebSphere MQ reported an error.
Use the linked exception to determine the cause of this error. / xmse.LinkedException.StackTrace: | / xmse.StackTrace: at IBM.XMS.Client.WMQ.ProducerShadow.CheckNmqiCallSuccess(String messageid, WmqDestination destination, String probeid, Int32 cc, Int32 rc)
at IBM.XMS.Client.WMQ.SpiIdentifiedProducerShadow.SendInternal(MQMessageDescriptor md, Byte[] buffers, Int32 msgLength)
at IBM.XMS.Client.WMQ.ProducerShadow.Send(WmqDestination destAtSendCall, WmqMessage message)
at IBM.XMS.Client.WMQ.WmqMessageProducer.Send(ProviderDestination destAtSendCall, ProviderMessage message)
at IBM.XMS.Client.Impl.XmsMessageProducerImpl.SendMessage(IMessage message, XmsDestinationImpl dest)
at IBM.XMS.Client.Impl.XmsMessageProducerImpl.Send_(Boolean inIdentifiedContext, XmsDestinationImpl dest, IMessage message, DeliveryMode deliveryMode, Int32 priority, Int64 timeToLive, Boolean explicitDlvModePriorityAndTimeToLive)
at IBM.XMS.Client.Impl.XmsMessageProducerImpl.Send(IMessage message)
at DVS.Services.Common.MQHandler.QueueHandler.SendTextMessage(String message, String correlationId, Boolean replyToRequestQueue)
从跟踪中,我可以看到生产者在连接名称列表中有我的两个活动/备用主机,但也有“localhost”作为host_name和1414作为端口,这是我不能连接到它的原因吗?
producer: XMSC_WMQ_BROKER_PUBQ_QMGR :
XMSC_CONNECTION_TYPE_NAME : IBM.XMS.Client.WMQ
XMSC_DISABLE_MSG_ID : False
XMSC_WMQ_RESOLVED_QUEUE_MANAGER_ID : QM1_2017-08-02_15.25.10
XMSC_WMQ_CLEANUP_INTERVAL : 3600000
XMSC_WMQ_BROKER_PUBQ : SYSTEM.BROKER.DEFAULT.STREAM
XMSC_WMQ_BROKER_SUBQ : SYSTEM.JMS.ND.SUBSCRIBER.QUEUE
XMSC_WMQ_PUB_ACK_INTERVAL : 25
targetClient : 0
XMSC_WMQ_CLEANUP_LEVEL : 1
XMSC_WMQ_MESSAGE_RETENTION : 1
XMSC_WMQ_PORT : 1414
XMSC_WMQ_PROVIDER_VERSION : 7
CCSID : 1208
deliveryMode : 2
XMSC_ADMIN_OBJECT_TYPE : 20
brokerVersion : 0
XMSC_WMQ_USE_CONNECTION_POOLING : True
XMSC_WMQ_TEMP_Q_PREFIX :
XMSC_ACKNOWLEDGE_MODE : 4
XMSC_WMQ_BROKER_CONTROLQ : SYSTEM.BROKER.CONTROL.QUEUE
failIfQuiesce : 1
XMSC_WMQ_MESSAGE_SELECTION : 0
XMSC_ASYNC_EXCEPTIONS : -1
timeToLive : 0
XMSC_WMQ_CONNECTION_MODE : 1
XMSC_WMQ_RESOLVED_QUEUE_MANAGER : QM1
XMSC_WMQ_CONNECTION_NAME_LIST : host1(11111),host2(11111)
XMSC_WMQ_QMGR_CCSID : 819
XMSC_WMQ_SHARE_CONV_ALLOWED : 1
XMSC_WMQ_CLIENT_RECONNECT_TIMEOUT : 1800
XMSC_WMQ_MAP_NAME_STYLE : True
XMSC_PASSWORD : ********
priority : 4
XMSC_WMQ_LOCAL_ADDRESS :
XMSC_WMQ_MAX_BUFFER_SIZE : 1000
XMSC_WMQ_CONNECT_OPTIONS : 0
XMSC_DISABLE_MSG_TS : False
XMSC_WMQ_BROKER_QMGR :
XMSC_WMQ_CLIENT_RECONNECT_OPTIONS : 16777216
version : 7
XMSC_WMQ_CONNECTION_TAG : System.Byte[]
encoding : 546
XMSC_WMQ_POLLING_INTERVAL : 5000
XMSC_WMQ_RESCAN_INTERVAL : 5000
XMSC_WMQ_TEMPORARY_MODEL : SYSTEM.DEFAULT.MODEL.QUEUE
XMSC_WMQ_CHANNEL : MY.SVC.SVRCONN.P
XMSC_CONNECTION_TYPE : 1
XMSC_WMQ_SYNCPOINT_ALL_GETS : False
XMSC_WMQ_HOST_NAME : localhost
XMSC_WMQ_QUEUE_MANAGER : QM1
wildcardFormat : 0
XMSC_WMQ_BROKER_DUR_SUBQ : SYSTEM.JMS.D.SUBSCRIBER.QUEUE
XMSC_TRANSACTED : True
XMSC_WMQ_MSG_BATCH_SIZE : 10
不支持与分布式事务的自动客户端重新连接,这就是您看到的原因
|XMSException.LinkedException on (SendTextMessage) sending message to Queue handler ABC:(In ABC.XYZ.REQUEST / Out XYZ.ABC.RESPONSE) / xmse.LinkedException.Message : **2012** / xmse.Message : Failed to send a message to destination XYZ.ABC.RESPONSE.
2012是mqrc_environment_error。
以下链接讨论它:https://www.ibm.com/support/knowledgecenter/ssfksj_9.1.0/com.ibm.mq.con.doc/q018380_.htm
我需要将消息发送到Azure服务总线中的队列。我使用HTTP Post发送消息,但我需要提高我的流量,然后我决定测试AMQP协议。 代码如下: 当我开始这条路线时,通信工作,但是对于骆驼发送给Servicebus的每一条消息,我得到了以下日志: Camel正在为每条消息花费一秒钟的时间发送到Servicebus。这是正常的行为吗?有没有可能让骆驼发送得更快?
我是activeMQ的新手,在将消息从驻留在另一台服务器上的消息生成器推送到activeMQ定义的队列时遇到问题。 我在activeMQ上使用camel routes创建的应用程序中有几个队列。我尝试从另一台服务器上的应用程序对这些队列执行远程JNDI查找。我使用了来自http://activemq.apache.org/jndi-support.html页面的activemq文档片段。 我可以连
我有两个独立实例(p1、p2)的生产者应用程序和两个独立实例(c1、c2)的消费者应用程序。 生产者p1连接到exchange,主题为t1,队列名称为name1。 使用者c1连接到exchange,主题为t1,队列名称为name1。 生产者p2连接到exchange,主题为t2,队列名称为name1。 使用者c2连接到exchange,主题为t2,队列名称为name1。 我在RabbitMQ GU
我试图通过驼峰路由将消息放到Weblogic JMS中的队列中。 我的目标是最终配置一个Route以使用来自jms队列的消息,我将早期Route的数据发布到该队列。 这是我的配置: 我的路线如下所示: 我尝试执行此路由时遇到此异常: 我按照以下过程创建了此处提到的队列:https://blogs.oracle.com/soaproactive/entry/how_to_create_a_simpl
兔子配置: 应用概述:每当gitRepository连接到我们的应用程序时,存储库名称就会成为交换名称,在这种情况下,然后存储库的每个分支都会创建自己的队列,这里有两个队列和。现在每次在开发分支中创建拉取请求时,我都需要将信息传递给开发队列,并且应该由特定的侦听器侦听,该侦听器应该仅注册用于开发。我看到了动态队列的示例,但我似乎找不到任何关于如何创建将使用不同线程执行的动态侦听器的示例,我如何实现
问题内容: 我基于Apache骆驼的应用正在消耗来自IBM队列之一的消息,例如下面是连接工厂的详细信息 消耗和处理并将响应发送到来自消息头的ReplyQueue的骆驼流。 在骆驼标头中,我在JMSReplyQueue下面。您可以看到它是不同的队列管理器,并且该队列管理器来自不同的主机,但是在集群环境中。 队列管理器也在两者之间。喜欢 以下是我在发送消息时遇到的异常。 任何人都可以帮助我将消息发送到