/** * @return a new object instance */ public DataStructure createObject() { return new MessageAck(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageAck(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageAck(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageAck(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageAck(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageAck(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageAck(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageAck(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageAck(); }
@Override public void execute() throws Exception { // Checkpoint the acknowledged messages. Iterator<SubscriptionKey> iterator = cpAckedLastAckLocations.keySet().iterator(); while (iterator.hasNext()) { SubscriptionKey subscriptionKey = iterator.next(); MessageId identity = cpAckedLastAckLocations.get(subscriptionKey); MessageAck ack = new MessageAck(); ack.setMessageID(identity); longTermStore.acknowledge(transactionTemplate.getContext(), subscriptionKey.clientId, subscriptionKey.subscriptionName, identity, ack); } } });
void acknowledge(MessageDispatch md, byte ackType) throws JMSException { MessageAck ack = new MessageAck(md, ackType, 1); if (ack.isExpiredAck()) { ack.setFirstMessageId(ack.getLastMessageId()); } session.sendAck(ack); synchronized(deliveredMessages){ deliveredMessages.remove(md); } }
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); }
protected void removeMessage(ConnectionContext c, Subscription subs, QueueMessageReference r) throws IOException { MessageAck ack = new MessageAck(); ack.setAckType(MessageAck.STANDARD_ACK_TYPE); ack.setDestination(destination); ack.setMessageID(r.getMessageId()); removeMessage(c, subs, r, ack); }
public void onCompletion(FutureResponse future) { try { Response response = future.getResult(); if (response.isException()) { ExceptionResponse er = (ExceptionResponse)response; serviceLocalException(er.getException()); } else { dequeueCounter.incrementAndGet(); localBroker.oneway(new MessageAck(md, MessageAck.STANDARD_ACK_TYPE, 1)); } } catch (IOException e) { serviceLocalException(e); } } };
private void immediateIndividualTransactedAck(MessageDispatch md) throws JMSException { // acks accumulate on the broker pending transaction completion to indicate // delivery status registerSync(); MessageAck ack = new MessageAck(md, MessageAck.INDIVIDUAL_ACK_TYPE, 1); ack.setTransactionId(session.getTransactionContext().getTransactionId()); session.sendAck(ack); }
@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); } }
/** * store will have a pending ack for all durables, irrespective of the * selector so we need to ack if node is un-matched */ @Override public void unmatched(MessageReference node) throws IOException { MessageAck ack = new MessageAck(); ack.setAckType(MessageAck.UNMATCHED_ACK_TYPE); ack.setMessageID(node.getMessageId()); Destination regionDestination = (Destination) node.getRegionDestination(); regionDestination.acknowledge(this.getContext(), this, ack, node); }
protected MessageAck convertToNonRangedAck(MessageAck ack, MessageReference node) { // the original ack may be a ranged ack, but we are trying to delete // a specific // message store here so we need to convert to a non ranged ack. if (ack.getMessageCount() > 0) { // Dup the ack MessageAck a = new MessageAck(); ack.copy(a); ack = a; // Convert to non-ranged. ack.setMessageCount(1); } // always use node messageId so we can access entry/data Location ack.setFirstMessageId(node.getMessageId()); ack.setLastMessageId(node.getMessageId()); return ack; }
@Override public void onCompletion(FutureResponse future) { try { Response response = future.getResult(); if (response.isException()) { ExceptionResponse er = (ExceptionResponse) response; serviceLocalException(md, er.getException()); } else { localBroker.oneway(new MessageAck(md, MessageAck.INDIVIDUAL_ACK_TYPE, 1)); networkBridgeStatistics.getDequeues().increment(); } } catch (IOException e) { serviceLocalException(md, e); } finally { sub.decrementOutstandingResponses(); } } });
public void remove(SubscriptionView view, String messageId) throws Exception { ActiveMQDestination destination = getTopicDestination(view); if (destination != null) { final Destination topic = getTopicRegion().getDestinationMap().get(destination); final MessageAck messageAck = new MessageAck(); messageAck.setMessageID(new MessageId(messageId)); messageAck.setDestination(destination); topic.getMessageStore().removeMessage(brokerService.getAdminConnectionContext(), messageAck); // if sub is active, remove from cursor if (view.subscription instanceof DurableTopicSubscription) { final DurableTopicSubscription durableTopicSubscription = (DurableTopicSubscription) view.subscription; final MessageReference messageReference = new NullMessageReference(); messageReference.getMessage().setMessageId(messageAck.getFirstMessageId()); durableTopicSubscription.getPending().remove(messageReference); } } else { throw new IllegalStateException("can't determine topic for sub:" + view); } }