I am trying to insert message header into amq. There is no specific method in JMSTemplate for setting header in amq. when I set like this it will save in StringProperty instead of header. For saving into header how to pass data
amqTemplate.convertAndSend(goMQ, message,new MessagePostProcessor() {
@Override
public Message postProcessMessage(Message message) throws JMSException {
message.setStringProperty("test1","testdata");
message.setStringProperty("country","US");
//setObjectProperty -- also set the string property
return message;
}
});
I need to send the data into header and client will implement selector for my message header.