本文整理了Java中org.apache.activemq.broker.Broker.sendToDeadLetterQueue()
方法的一些代码示例,展示了Broker.sendToDeadLetterQueue()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Broker.sendToDeadLetterQueue()
方法的具体详情如下:
包路径:org.apache.activemq.broker.Broker
类名称:Broker
方法名:sendToDeadLetterQueue
[英]A message needs to go the a DLQ
[中]需要通过DLQ发送消息
代码示例来源:origin: apache/activemq
@Override
public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference,
Subscription subscription, Throwable poisonCause) {
return getNext().sendToDeadLetterQueue(context, messageReference, subscription, poisonCause);
}
代码示例来源:origin: apache/activemq
/**
*
* @param context
* @param node
* @param poisonCause
* @throws IOException
* @throws Exception
*/
protected void sendToDLQ(final ConnectionContext context, final MessageReference node, Throwable poisonCause) throws IOException, Exception {
broker.getRoot().sendToDeadLetterQueue(context, node, this, poisonCause);
}
代码示例来源:origin: apache/activemq
@Override
public void messageExpired(ConnectionContext context, MessageReference node, Subscription subscription) {
LOG.debug("Message expired {}", node);
getRoot().sendToDeadLetterQueue(context, node, subscription, new Throwable("Message Expired. Expiration:" + node.getExpiration()));
}
代码示例来源:origin: apache/activemq
@Override
public void duplicateFromStore(Message message, Subscription subscription) {
ConnectionContext connectionContext = createConnectionContext();
getLog().warn("{}{}, redirecting {} for dlq processing", DUPLICATE_FROM_STORE_MSG_PREFIX, destination, message.getMessageId());
Throwable cause = new Throwable(DUPLICATE_FROM_STORE_MSG_PREFIX + destination);
message.setRegionDestination(this);
broker.getRoot().sendToDeadLetterQueue(connectionContext, message, null, cause);
MessageAck messageAck = new MessageAck(message, MessageAck.POSION_ACK_TYPE, 1);
messageAck.setPoisonCause(cause);
try {
acknowledge(connectionContext, subscription, messageAck, message);
} catch (IOException e) {
getLog().error("Failed to acknowledge duplicate message {} from {} with {}", message.getMessageId(), destination, messageAck);
}
}
代码示例来源:origin: apache/activemq
private void discard(MessageReference message) {
discarding = true;
try {
message.decrementReferenceCount();
matched.remove(message);
discarded++;
if (destination != null) {
destination.getDestinationStatistics().getDequeues().increment();
}
LOG.debug("{}, discarding message {}", this, message);
Destination dest = (Destination) message.getRegionDestination();
if (dest != null) {
dest.messageDiscarded(getContext(), this, message);
}
broker.getRoot().sendToDeadLetterQueue(getContext(), message, this, new Throwable("TopicSubDiscard. ID:" + info.getConsumerId()));
} finally {
discarding = false;
}
}
代码示例来源:origin: apache/activemq
store.removeMessage(connectionContext, new MessageAck(ref.getMessage(), MessageAck.POSION_ACK_TYPE, 1));
broker.getRoot().sendToDeadLetterQueue(connectionContext, ref.getMessage(), null, new Throwable("duplicate paged in from cursor for " + destination));
代码示例来源:origin: apache/activemq
} else {
dropped = false;
return next.sendToDeadLetterQueue(ctx, msgRef, subscription, poisonCause);
代码示例来源:origin: org.apache.activemq/activemq-broker
@Override
public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference,
Subscription subscription, Throwable poisonCause) {
return getNext().sendToDeadLetterQueue(context, messageReference, subscription, poisonCause);
}
代码示例来源:origin: org.apache.activemq/activemq-all
@Override
public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference,
Subscription subscription, Throwable poisonCause) {
return getNext().sendToDeadLetterQueue(context, messageReference, subscription, poisonCause);
}
代码示例来源:origin: org.apache.activemq/activemq-all
/**
*
* @param context
* @param node
* @param poisonCause
* @throws IOException
* @throws Exception
*/
protected void sendToDLQ(final ConnectionContext context, final MessageReference node, Throwable poisonCause) throws IOException, Exception {
broker.getRoot().sendToDeadLetterQueue(context, node, this, poisonCause);
}
代码示例来源:origin: org.apache.activemq/activemq-broker
/**
*
* @param context
* @param node
* @param poisonCause
* @throws IOException
* @throws Exception
*/
protected void sendToDLQ(final ConnectionContext context, final MessageReference node, Throwable poisonCause) throws IOException, Exception {
broker.getRoot().sendToDeadLetterQueue(context, node, this, poisonCause);
}
代码示例来源:origin: pierre/meteo
/**
* @param context
* @param node
* @throws IOException
* @throws Exception
*/
protected void sendToDLQ(final ConnectionContext context, final MessageReference node) throws IOException, Exception {
broker.getRoot().sendToDeadLetterQueue(context, node, this);
}
代码示例来源:origin: pierre/meteo
@Override
public void messageExpired(ConnectionContext context, MessageReference node, Subscription subscription) {
if (LOG.isDebugEnabled()) {
LOG.debug("Message expired " + node);
}
getRoot().sendToDeadLetterQueue(context, node, subscription);
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
/**
*
* @param context
* @param node
* @param poisonCause
* @throws IOException
* @throws Exception
*/
protected void sendToDLQ(final ConnectionContext context, final MessageReference node, Throwable poisonCause) throws IOException, Exception {
broker.getRoot().sendToDeadLetterQueue(context, node, this, poisonCause);
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
@Override
public boolean sendToDeadLetterQueue(ConnectionContext context, MessageReference messageReference,
Subscription subscription, Throwable poisonCause) {
return getNext().sendToDeadLetterQueue(context, messageReference, subscription, poisonCause);
}
代码示例来源:origin: org.apache.activemq/activemq-broker
@Override
public void messageExpired(ConnectionContext context, MessageReference node, Subscription subscription) {
LOG.debug("Message expired {}", node);
getRoot().sendToDeadLetterQueue(context, node, subscription, new Throwable("Message Expired. Expiration:" + node.getExpiration()));
}
代码示例来源:origin: org.apache.activemq/activemq-all
@Override
public void messageExpired(ConnectionContext context, MessageReference node, Subscription subscription) {
LOG.debug("Message expired {}", node);
getRoot().sendToDeadLetterQueue(context, node, subscription, new Throwable("Message Expired. Expiration:" + node.getExpiration()));
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
@Override
public void messageExpired(ConnectionContext context, MessageReference node, Subscription subscription) {
LOG.debug("Message expired {}", node);
getRoot().sendToDeadLetterQueue(context, node, subscription, new Throwable("Message Expired. Expiration:" + node.getExpiration()));
}
代码示例来源:origin: pierre/meteo
protected void discard(MessageReference message) {
message.decrementReferenceCount();
if (LOG.isDebugEnabled()) {
LOG.debug("Discarding message " + message);
}
ConnectionContext ctx = new ConnectionContext(new NonCachedMessageEvaluationContext());
ctx.setBroker(broker);
broker.getRoot().sendToDeadLetterQueue(ctx, message, null);
}
代码示例来源:origin: org.apache.activemq/activemq-osgi
@Override
public void duplicateFromStore(Message message, Subscription durableSub) {
ConnectionContext connectionContext = createConnectionContext();
getLog().warn("duplicate message from store {}, redirecting for dlq processing", message.getMessageId());
Throwable cause = new Throwable("duplicate from store for " + destination);
message.setRegionDestination(this);
broker.getRoot().sendToDeadLetterQueue(connectionContext, message, null, cause);
MessageAck messageAck = new MessageAck(message, MessageAck.POSION_ACK_TYPE, 1);
messageAck.setPoisonCause(cause);
try {
acknowledge(connectionContext, durableSub, messageAck, message);
} catch (IOException e) {
getLog().error("Failed to acknowledge duplicate message {} from {} with {}", message.getMessageId(), destination, messageAck);
}
}
内容来源于网络,如有侵权,请联系作者删除!