public void replayAcknowledge(ConnectionContext context, String clientId, String subscritionName, MessageId messageId) { try { SubscriptionInfo sub = longTermStore.lookupSubscription(clientId, subscritionName); if (sub != null) { longTermStore.acknowledge(context, clientId, subscritionName, messageId, null); } } catch (Throwable e) { LOG.debug("Could not replay acknowledge for message '" + messageId + "'. Message may have already been acknowledged. reason: " + e); } }
@Override public SubscriptionInfo[] getAllSubscriptions() throws IOException { return longTermStore.getAllSubscriptions(); }
@Override public void recoverSubscription(String clientId, String subscriptionName, MessageRecoveryListener listener) throws Exception { ((TopicMessageStore)delegate).recoverSubscription(clientId, subscriptionName, listener); }
SubscriptionInfo info = topicStore.lookupSubscription(clientId, subscriptionName); if (info != null) { topicStore.deleteSubscription(clientId, subscriptionName); info = null; topicStore.addSubscription(info, subscription.getConsumerInfo().isRetroactive()); msgContext.setDestination(destination); if (subscription.isRecoveryRequired()) { topicStore.recoverSubscription(clientId, subscriptionName, new MessageRecoveryListener() { @Override public boolean recoverMessage(Message message) throws Exception {
@Override public Future<Object> run(ConnectionContext ctx) throws IOException { destination.acknowledge(ctx, clientId, subscriptionName, messageId, ack); return AbstractMessageStore.FUTURE; } });
@Override public int getMessageCount(String clientId, String subscriberName) throws IOException { return ((TopicMessageStore)delegate).getMessageCount(clientId, subscriberName); }
@Override public void recoverNextMessages(String clientId, String subscriptionName, int maxReturned, MessageRecoveryListener listener) throws Exception { ((TopicMessageStore)delegate).recoverNextMessages(clientId, subscriptionName, maxReturned, listener); }
@Override public void deleteSubscription(String clientId, String subscriptionName) throws IOException { longTermStore.deleteSubscription(clientId, subscriptionName); }
@Override protected void resetBatch() { this.store.resetBatching(clientId, subscriberName); }
@Override public void addSubscription(SubscriptionInfo subscriptionInfo, boolean retroactive) throws IOException { ((TopicMessageStore)delegate).addSubscription(subscriptionInfo, retroactive); }
@Override public SubscriptionInfo lookupSubscription(String clientId, String subscriptionName) throws IOException { return longTermStore.lookupSubscription(clientId, subscriptionName); }
@Override public void addMessage(ConnectionContext context, Message message) throws IOException { delegate.addMessage(context, message); }
SubscriptionInfo info = topicStore.lookupSubscription(clientId, subscriptionName); if (info != null) { topicStore.deleteSubscription(clientId, subscriptionName); info = null; topicStore.addSubscription(info, subscription.getConsumerInfo().isRetroactive()); msgContext.setDestination(destination); if (subscription.isRecoveryRequired()) { topicStore.recoverSubscription(clientId, subscriptionName, new MessageRecoveryListener() { @Override public boolean recoverMessage(Message message) throws Exception {
@Override public void run(ConnectionContext ctx) throws IOException { destination.acknowledge(ctx, clientId, subscriptionName, messageId, ack); }
@Override protected synchronized int getStoreSize() { try { return store.getMessageCount(clientId, subscriberName); } catch (Exception e) { LOG.error("{} Failed to get the outstanding message count from the store", this, e); throw new RuntimeException(e); } }
@Override public void recoverNextMessages(String clientId, String subscriptionName, int maxReturned, MessageRecoveryListener listener) throws Exception { this.peristenceAdapter.checkpoint(true, true); longTermStore.recoverNextMessages(clientId, subscriptionName, maxReturned, listener); }
@Override public void deleteSubscription(String clientId, String subscriptionName) throws IOException { ((TopicMessageStore)delegate).deleteSubscription(clientId, subscriptionName); }
@Override public void resetBatching(String clientId, String subscriptionName) { ((TopicMessageStore)delegate).resetBatching(clientId, subscriptionName); }
@Override public void addSubscription(SubscriptionInfo subscriptionInfo, boolean retroactive) throws IOException { this.peristenceAdapter.checkpoint(true, true); longTermStore.addSubscription(subscriptionInfo, retroactive); }
@Override public SubscriptionInfo lookupSubscription(String clientId, String subscriptionName) throws IOException { return ((TopicMessageStore)delegate).lookupSubscription(clientId, subscriptionName); }