Advertisement
Guest User

azure service bus freaky contents

a guest
Nov 4th, 2015
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1.  
  2. JAVA MESSAGE PRODUCER (using QPID libraries per Azure JMS tutorial):
  3. TextMessage message = sendSession.createTextMessage();
  4. message.setText("Test AMQP message from JMS");
  5. long randomMessageID = randomGenerator.nextLong() >>>1;
  6. message.setJMSMessageID("ID:" + randomMessageID);
  7. sender.send(message);
  8. System.out.println("Sent message with JMSMessageID = " + message.getJMSMessageID());
  9.  
  10. OUTPUT:
  11. Sent message with JMSMessageID = ID:2414932965987073843
  12.  
  13. NODEJS MESSAGE CONSUMER:
  14. serviceBus.receiveQueueMessage(queue, {timeoutIntervalInS: timeOut, isReceiveAndDelete: true}, function(err, message) {
  15. if(message !==null)console.log(util.inspect(message, {showHidden: false, depth: null}));
  16. });
  17.  
  18. OUTPUT:
  19. { body: '@\u0006string\b3http://schemas.microsoft.com/2003/10/Serialization/�\u001aTest AMQP message from JMS',
  20. brokerProperties:
  21. { DeliveryCount: 1,
  22. EnqueuedSequenceNumber: 5000004,
  23. EnqueuedTimeUtc: 'Wed, 04 Nov 2015 21:28:21 GMT',
  24. MessageId: '2414932965987073843',
  25. PartitionKey: '89',
  26. SequenceNumber: 59672695067659070,
  27. State: 'Active',
  28. TimeToLive: 1209600,
  29. To: 'moequeue' },
  30. contentType: 'application/xml; charset=utf-8' }
  31.  
  32.  
  33. If I compare that to a message inserted into the queue via serviceBus.sendQueueMessage(), then the properties look like this:
  34.  
  35. { body: 'test message',
  36. brokerProperties:
  37. { DeliveryCount: 1,
  38. EnqueuedSequenceNumber: 0,
  39. EnqueuedTimeUtc: 'Wed, 04 Nov 2015 21:44:03 GMT',
  40. MessageId: 'bc0a3d4f-15ba-434f-9fb0-1a3789885f8c',
  41. PartitionKey: '734',
  42. SequenceNumber: 37436171906517256,
  43. State: 'Active',
  44. TimeToLive: 1209600 },
  45. contentType: 'text/plain',
  46. customProperties:
  47. { message_number: 0,
  48. sent_date: Wed Nov 04 2015 21:44:03 GMT+0000 (UTC) } }
  49.  
  50. 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
  51. Is that the result of serialization? How can this be mitigated?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement