chetan singhal
chetan singhal

Reputation: 948

How get value from mule payload

How I get value from mule payload. I am unable to get from mule payload.

 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====
}

Upvotes: 0

Views: 1122

Answers (4)

krishna
krishna

Reputation: 1

You can extract payload using #[message.payload] and value from #[message.payload.'key']

Upvotes: 0

David Dossot
David Dossot

Reputation: 33413

You can retrieve the original payload from an org.mule.message.ExceptionMessage payload with:

#[message.payload.payload]

Upvotes: 1

Bachu Arjun
Bachu Arjun

Reputation: 61

First you know your payload type whether it is String or Object then try to make use of the methods on payload.

Upvotes: 0

Please check if the message you're printing is actually a complex object or a string representation of the message, that would define the strategy for accessing the values.

For this you can log with the following expression #[payload.getClass().getName()]

Upvotes: 0

Related Questions