本文整理汇总了Java中org.apache.activemq.command.ActiveMQMessage.getDestination方法的典型用法代码示例。如果您正苦于以下问题:Java ActiveMQMessage.getDestination方法的具体用法?Java ActiveMQMessage.getDestination怎么用?Java ActiveMQMessage.getDestination使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.activemq.command.ActiveMQMessage
的用法示例。
在下文中一共展示了ActiveMQMessage.getDestination方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMessageDispatch
import org.apache.activemq.command.ActiveMQMessage; //导入方法依赖的package包/类
public MessageDispatch createMessageDispatch(MessageReference reference,
ICoreMessage message,
AMQConsumer consumer) throws IOException, JMSException {
ActiveMQMessage amqMessage = toAMQMessage(reference, message, consumer.getOpenwireDestination());
//we can use core message id for sequenceId
amqMessage.getMessageId().setBrokerSequenceId(message.getMessageID());
MessageDispatch md = new MessageDispatch();
md.setConsumerId(consumer.getId());
md.setRedeliveryCounter(reference.getDeliveryCount() - 1);
md.setDeliverySequenceId(amqMessage.getMessageId().getBrokerSequenceId());
md.setMessage(amqMessage);
ActiveMQDestination destination = amqMessage.getDestination();
md.setDestination(destination);
return md;
}
示例2: onMessageCreated
import org.apache.activemq.command.ActiveMQMessage; //导入方法依赖的package包/类
@Override
public void onMessageCreated(Message message, Session session, Exchange exchange, Throwable cause) {
if (exchange.getIn() instanceof JmsMessage) {
JmsMessage msg = exchange.getIn(JmsMessage.class);
Message jms = msg.getJmsMessage();
if (message instanceof ActiveMQMessage) {
ActiveMQMessage amq = (ActiveMQMessage) jms;
ActiveMQDestination from = amq.getDestination();
if (from != null && message instanceof ActiveMQMessage) {
((ActiveMQMessage) message).setOriginalDestination(from);
}
}
}
}
示例3: add
import org.apache.activemq.command.ActiveMQMessage; //导入方法依赖的package包/类
public void add(MessageReference node) {
ActiveMQMessage message = (ActiveMQMessage) node.getMessageHardRef();
ActiveMQDestination destination = message.getDestination();
MessageQueue queue = null;
synchronized (lock) {
queue = queueIndex.get(destination);
if (queue == null) {
queue = messageBuffer.createMessageQueue();
queueIndex.put(destination, queue);
subscriptionIndex.put(destination, queue);
}
}
queue.add(node);
}
示例4: dispatchInitialMessage
import org.apache.activemq.command.ActiveMQMessage; //导入方法依赖的package包/类
protected void dispatchInitialMessage(Message message, Destination regionDestination, ConnectionContext context, SubscriptionRecovery sub) {
try {
ActiveMQMessage activeMessage = ActiveMQMessageTransformation.transformMessage(message, null);
ActiveMQDestination destination = activeMessage.getDestination();
if (destination == null) {
destination = sub.getActiveMQDestination();
activeMessage.setDestination(destination);
}
activeMessage.setRegionDestination(regionDestination);
configure(activeMessage);
sub.addRecoveredMessage(context, activeMessage);
} catch (Throwable e) {
LOG.warn("Failed to dispatch initial message: {} into subscription. Reason: ", message, e);
}
}