* @param destination
* @return create ActiveMQMessage
*/
private ActiveMQMessage generateAdvisoryMessage(final ConsumerInfo advisoryTarget, final Packet payload,
final ActiveMQDestination destination) {
ActiveMQObjectMessage advisoryMsg = null;
try {
advisoryMsg = new ActiveMQObjectMessage();
advisoryMsg.setJMSMessageID(idGen.generateId());
advisoryMsg.setJMSDestination(destination);
advisoryMsg.setExternalMessageId(true);
advisoryMsg.setDeliveryCount(DeliveryMode.NON_PERSISTENT);
advisoryMsg.setObject((Serializable) payload);
if (advisoryTarget != null) {
advisoryMsg.setConsumerNos(new int[]{advisoryTarget.getConsumerNo()});
}
}
catch (JMSException e) {
advisoryMsg = null;
log.warn("caught an exception generating an advisory", e);