简体   繁体   English

Mule JMS消息被截断-IBM MQ

[英]Mule JMS message truncated - IBM MQ

I have an issue that my jms message is not fully sent to the queue and is truncated, only 100 charachters are set into the queue. 我有一个问题,我的jms消息未完全发送到队列,被截断了,队列中仅设置了100个字符。 Here is my configurations: 这是我的配置:

<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:util="http://www.springframework.org/schema/util"
xmlns:spring="http://www.springframework.org/schema/beans" xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns:jms="http://www.mulesoft.org/schema/mule/jms" xmlns:vm="http://www.mulesoft.org/schema/mule/vm"
xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:task="http://www.springframework.org/schema/task"
xmlns:script="http://www.mulesoft.org/schema/mule/scripting"

xsi:schemaLocation="
      http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/3.4/mule.xsd
      hhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
      http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/3.4/mule-http.xsd
      http://www.mulesoft.org/schema/mule/jms http://www.mulesoft.org/schema/mule/jms/3.4/mule-jms.xsd
      http://www.mulesoft.org/schema/mule/vm http://www.mulesoft.org/schema/mule/vm/3.4/mule-vm.xsd
      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.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/scripting http://www.mulesoft.org/schema/mule/scripting/3.3/mule-scripting.xsd
      http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.1.xsd">


<spring:bean id="MQConnectionFactory"  class="com.ibm.mq.jms.MQQueueConnectionFactory">
   <spring:property name="transportType" value="1" />
   <spring:property name="hostName" value="222.222.100.58"/>
   <spring:property name="port" value="1414"/>           
   <spring:property name="queueManager" value="ESBDEVBKRQM"/>
</spring:bean>

<jms:connector name="WebsphereMQConnector"
    connectionFactory-ref="MQConnectionFactory" 
    username="Administrator" password="*****"
    numberOfConsumers="200" />


<flow name="test-webSphere-flow">
    <http:inbound-endpoint address="http://localhost:8081/test/in/websphere3" method="POST"/>
    <object-to-string-transformer />
    <jms:outbound-endpoint queue="ACCT_Q_REQ" connector-ref="WebsphereMQConnector"/>
</flow>

</mule>

To make sure that the problem is not from the wepshpere mq side, i used java code with ibm API to send the message, and it was fully sent 为了确保问题不是来自wepshpere mq方面,我将Java代码与ibm API一起使用来发送消息,并且消息已完全发送

package jms;

import javax.jms.Connection;
import javax.jms.JMSException;
import javax.jms.MessageProducer;
import javax.jms.ObjectMessage;
import javax.jms.Queue;

import javax.jms.Session;
import javax.jms.TextMessage;

import com.ibm.mq.jms.MQQueueConnectionFactory;


public class TestJMS {

    void send() {
        String destinationName = "ACCT_Q_REQ";

        MessageProducer producer = null;
        Connection connection = null;
        Session session = null;

        try {

            MQQueueConnectionFactory MQQueueConnectionFactory = new MQQueueConnectionFactory();
            MQQueueConnectionFactory.setTransportType(1);
            MQQueueConnectionFactory.setHostName("222.222.100.58");
            MQQueueConnectionFactory.setPort(1414);
            MQQueueConnectionFactory.setQueueManager("ESBDEVBKRQM");

            connection = MQQueueConnectionFactory.createConnection("Administrator", "******");

            session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
            Queue source = session.createQueue(destinationName);
            producer = session.createProducer(source);
            connection.start();

            String text = ".....";
            TextMessage objectMessage = session.createTextMessage();
            objectMessage.setText(text);
            producer.send(objectMessage);

        } catch (JMSException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        new TestJMS().send();
    }

}

What might be the issue here? 这里可能是什么问题?

You should check all the MQ relevant maximum message size limiters: 您应该检查所有与MQ相关的最大消息大小限制器:

  1. the MQ connection's MaxMsgLength - this is part of your MQQueueConnectionFactory MQ连接的MaxMsgLength-这是MQQueueConnectionFactory的一部分
  2. the queue managers maximum message length, MAXMSGL 队列管理器的最大消息长度MAXMSGL
  3. the queue's MQIA_MAX_MSG_LENGTH 队列的MQIA_MAX_MSG_LENGTH
  4. and if you are receiving messages over an MQ channel, even the channel's MAXMSGL 如果您正在通过MQ通道接收消息,则即使该通道的MAXMSGL

all of the above must be set to a value higher than 1000 for things to work... 为了使一切正常,必须将以上所有条件设置为大于1000的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM