如何从mule有效载荷中获取价值

时间:2015-05-14 15:33:37

标签: exception mule esb payload

我如何从mule有效载荷中获得价值。我无法从骡子有效载荷中获得。

 ExceptionMessage{payload=ActiveMQTextMessage {commandId = 14, responseRequired = false, messageId = ID:localhost.localdomain-59898-1431596266048-1:1:5:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:localhost.localdomain-59898-1431596266048-1:1:5:1, destination = queue://delivery-queue-A, transactionId = TX:ID:localhost.localdomain-59898-1431596266048-1:1:1, expiration = 0, timestamp = 1431596274660, arrival = 0, brokerInTime = 1431596274672, brokerOutTime = 1431596274700, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = org.apache.activemq.util.ByteSequence@3128d4c1, marshalledProperties = org.apache.activemq.util.ByteSequence@6fa7e41d, dataStructure = null, redeliveryCounter = 3, size = 0, properties = {MULE_SESSION=, MULE_ROOT_MESSAGE_ID=e33be8a0-fa1c-11e4-9365-000c294271b7, MULE_ENDPOINT=jms://delivery-queue-A, Content_Type=text/plain;charset=UTF-8, MULE_ENCODING=UTF-8}, readOnlyProperties = true, readOnlyBody = true, droppable = false, jmsXGroupFirstForConsumer = false, text = CCD150507074415642 (copy).xml====
}

4 个答案:

答案 0 :(得分:1)

您可以使用以下内容从org.mule.message.ExceptionMessage有效负载检索原始有效负载。

#[message.payload.payload]

答案 1 :(得分:0)

请检查您正在打印的消息是否实际上是一个复杂的对象或消息的字符串表示,这将定义访问这些值的策略。

为此,您可以使用以下表达式#[payload.getClass().getName()]

进行记录

答案 2 :(得分:0)

首先你知道你的有效载荷类型是String还是Object然后尝试使用有效载荷上的方法。

答案 3 :(得分:0)

您可以使用#[message.payload]和#[message.payload.'key']中的值来提取有效负载