private void posionAck(MessageDispatch md, String cause) throws JMSException { MessageAck posionAck = new MessageAck(md, MessageAck.POSION_ACK_TYPE, 1); posionAck.setFirstMessageId(md.getMessage().getMessageId()); posionAck.setPoisonCause(new Throwable(cause)); session.sendAck(posionAck); }
try { MessageAck poisonAck = new MessageAck(messageDispatch, MessageAck.POSION_ACK_TYPE, 1); poisonAck.setPoisonCause(error); localBroker.oneway(poisonAck); } catch (IOException ioe) {
@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); } }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); MessageAck info = (MessageAck)o; info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setAckType(dataIn.readByte()); info.setFirstMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setLastMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setMessageCount(dataIn.readInt()); info.setPoisonCause((java.lang.Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs)); }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); MessageAck info = (MessageAck)o; info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setAckType(dataIn.readByte()); info.setFirstMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setLastMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setMessageCount(dataIn.readInt()); info.setPoisonCause((java.lang.Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs)); }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); MessageAck info = (MessageAck)o; info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setAckType(dataIn.readByte()); info.setFirstMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setLastMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setMessageCount(dataIn.readInt()); info.setPoisonCause((java.lang.Throwable) looseUnmarsalThrowable(wireFormat, dataIn)); }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); MessageAck info = (MessageAck)o; info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setAckType(dataIn.readByte()); info.setFirstMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setLastMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setMessageCount(dataIn.readInt()); info.setPoisonCause((java.lang.Throwable) looseUnmarsalThrowable(wireFormat, dataIn)); }
ack.setPoisonCause(new Throwable("Delivery[" + lastMd.getMessage().getRedeliveryCounter() + "] exceeds redelivery policy limit:" + redeliveryPolicy + ", cause:" + lastMd.getRollbackCause(), lastMd.getRollbackCause())); session.sendAck(ack,true);
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); MessageAck info = (MessageAck)o; info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setAckType(dataIn.readByte()); info.setFirstMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setLastMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setMessageCount(dataIn.readInt()); info.setPoisonCause((java.lang.Throwable) looseUnmarsalThrowable(wireFormat, dataIn)); }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); MessageAck info = (MessageAck)o; info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setAckType(dataIn.readByte()); info.setFirstMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setLastMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setMessageCount(dataIn.readInt()); info.setPoisonCause((java.lang.Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs)); }
ack.setPoisonCause(new Throwable("Exceeded ra redelivery policy limit:" + redeliveryPolicy)); asyncSendPacket(ack);
earlyAck = new MessageAck(md, MessageAck.POSION_ACK_TYPE, 1); earlyAck.setFirstMessageId(md.getMessage().getMessageId()); earlyAck.setPoisonCause(new Throwable("Duplicate delivery to " + this));
private void posionAck(MessageDispatch md, String cause) throws JMSException { MessageAck posionAck = new MessageAck(md, MessageAck.POSION_ACK_TYPE, 1); posionAck.setFirstMessageId(md.getMessage().getMessageId()); posionAck.setPoisonCause(new Throwable(cause)); session.sendAck(posionAck); }
private void posionAck(MessageDispatch md, String cause) throws JMSException { MessageAck posionAck = new MessageAck(md, MessageAck.POSION_ACK_TYPE, 1); posionAck.setFirstMessageId(md.getMessage().getMessageId()); posionAck.setPoisonCause(new Throwable(cause)); session.sendAck(posionAck); }
private void posionAck(MessageDispatch md, String cause) throws JMSException { MessageAck posionAck = new MessageAck(md, MessageAck.POSION_ACK_TYPE, 1); posionAck.setFirstMessageId(md.getMessage().getMessageId()); posionAck.setPoisonCause(new Throwable(cause)); session.sendAck(posionAck); }
@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); } }
@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); } }
@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); } }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void looseUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn) throws IOException { super.looseUnmarshal(wireFormat, o, dataIn); MessageAck info = (MessageAck)o; info.setDestination((org.apache.activemq.command.ActiveMQDestination) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setTransactionId((org.apache.activemq.command.TransactionId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setConsumerId((org.apache.activemq.command.ConsumerId) looseUnmarsalCachedObject(wireFormat, dataIn)); info.setAckType(dataIn.readByte()); info.setFirstMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setLastMessageId((org.apache.activemq.command.MessageId) looseUnmarsalNestedObject(wireFormat, dataIn)); info.setMessageCount(dataIn.readInt()); info.setPoisonCause((java.lang.Throwable) looseUnmarsalThrowable(wireFormat, dataIn)); }
/** * Un-marshal an object instance from the data input stream * * @param o the object to un-marshal * @param dataIn the data input stream to build the object from * @throws IOException */ public void tightUnmarshal(OpenWireFormat wireFormat, Object o, DataInput dataIn, BooleanStream bs) throws IOException { super.tightUnmarshal(wireFormat, o, dataIn, bs); MessageAck info = (MessageAck)o; info.setDestination((org.apache.activemq.command.ActiveMQDestination) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setTransactionId((org.apache.activemq.command.TransactionId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setConsumerId((org.apache.activemq.command.ConsumerId) tightUnmarsalCachedObject(wireFormat, dataIn, bs)); info.setAckType(dataIn.readByte()); info.setFirstMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setLastMessageId((org.apache.activemq.command.MessageId) tightUnmarsalNestedObject(wireFormat, dataIn, bs)); info.setMessageCount(dataIn.readInt()); info.setPoisonCause((java.lang.Throwable) tightUnmarsalThrowable(wireFormat, dataIn, bs)); }