Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- JAVA MESSAGE PRODUCER (using QPID libraries per Azure JMS tutorial):
- TextMessage message = sendSession.createTextMessage();
- message.setText("Test AMQP message from JMS");
- long randomMessageID = randomGenerator.nextLong() >>>1;
- message.setJMSMessageID("ID:" + randomMessageID);
- sender.send(message);
- System.out.println("Sent message with JMSMessageID = " + message.getJMSMessageID());
- OUTPUT:
- Sent message with JMSMessageID = ID:2414932965987073843
- NODEJS MESSAGE CONSUMER:
- serviceBus.receiveQueueMessage(queue, {timeoutIntervalInS: timeOut, isReceiveAndDelete: true}, function(err, message) {
- if(message !==null)console.log(util.inspect(message, {showHidden: false, depth: null}));
- });
- OUTPUT:
- { body: '@\u0006string\b3http://schemas.microsoft.com/2003/10/Serialization/�\u001aTest AMQP message from JMS',
- brokerProperties:
- { DeliveryCount: 1,
- EnqueuedSequenceNumber: 5000004,
- EnqueuedTimeUtc: 'Wed, 04 Nov 2015 21:28:21 GMT',
- MessageId: '2414932965987073843',
- PartitionKey: '89',
- SequenceNumber: 59672695067659070,
- State: 'Active',
- TimeToLive: 1209600,
- To: 'moequeue' },
- contentType: 'application/xml; charset=utf-8' }
- If I compare that to a message inserted into the queue via serviceBus.sendQueueMessage(), then the properties look like this:
- { body: 'test message',
- brokerProperties:
- { DeliveryCount: 1,
- EnqueuedSequenceNumber: 0,
- EnqueuedTimeUtc: 'Wed, 04 Nov 2015 21:44:03 GMT',
- MessageId: 'bc0a3d4f-15ba-434f-9fb0-1a3789885f8c',
- PartitionKey: '734',
- SequenceNumber: 37436171906517256,
- State: 'Active',
- TimeToLive: 1209600 },
- contentType: 'text/plain',
- customProperties:
- { message_number: 0,
- sent_date: Wed Nov 04 2015 21:44:03 GMT+0000 (UTC) } }
- So content type is different to start with - why? - and then where does the strange garbage in the body of the first message payload come from: @\u0006string\b3http://schemas.microsoft.com/2003/10/Serialization/�\u001a
- Is that the result of serialization? How can this be mitigated?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement