}
}
public synchronized void sendMessageBytes(byte[] data, HashMap<String, String> props) throws MistException {
try {
BytesMessage message = getJMSSession().createBytesMessage();
message.setBooleanProperty("JMS_SUN_COMPRESS", true);
for(Map.Entry<String, String> ent: props.entrySet()) {
try {
message.setStringProperty(ent.getKey(), ent.getValue());
}
catch(JMSException e) {
logger.warn(String.format("property (%s, %s) can not be set, skip", ent.getKey(), ent.getValue()));
}
}
message.writeBytes(data);
getProducer().send(message);
}
catch(JMSException e) {
logger.error(e.getMessage(), e);
throw new MistException(String.format("producer (%d): %s", getSessionId(), e.getMessage()));