Solace Sent SolBytesMessage Custom Parameters

Many times while using Solace messaging middle-ware you will get requirement to set custom message as well apart from generic messages parameter. This tutorial assumes that you already setup solace messaging with session object available then use below reference to set SolByteMessage Parameters:

SolBytesMessage solBytesMessage = (SolBytesMessage) session.createBytesMessage();

solBytesMessage.setJMSType("Message Type");
solBytesMessage.setJMSCorrelationID(UUID.randomUUID().toString());
solBytesMessage.setSenderID("Sender ID");
solBytesMessage.writeBytes("JavaHonk".getBytes());
solBytesMessage.setStringProperty("JavaHonk Command Target", "target");
solBytesMessage.setStringProperty("JavaHonk Command", "command");

Leave a Reply

Your email address will not be published. Required fields are marked *