@Override public void removeAsyncMessage(ConnectionContext context, MessageAck ack) throws IOException { if (isConcurrentStoreAndDispatchQueues()) { AsyncJobKey key = new AsyncJobKey(ack.getLastMessageId(), getDestination()); StoreQueueTask task = null; synchronized (asyncTaskMap) {
@Override public void removeAsyncMessage(ConnectionContext context, MessageAck ack) throws IOException { if (isConcurrentStoreAndDispatchQueues()) { AsyncJobKey key = new AsyncJobKey(ack.getLastMessageId(), getDestination()); StoreQueueTask task = null; synchronized (asyncTaskMap) {
@Override public void removeAsyncMessage(ConnectionContext context, MessageAck ack) throws IOException { if (isConcurrentStoreAndDispatchQueues()) { AsyncJobKey key = new AsyncJobKey(ack.getLastMessageId(), getDestination()); StoreQueueTask task = null; synchronized (asyncTaskMap) {
@Override public void removeAsyncMessage(ConnectionContext context, MessageAck ack) throws IOException { if (isConcurrentStoreAndDispatchQueues()) { AsyncJobKey key = new AsyncJobKey(ack.getLastMessageId(), getDestination()); StoreQueueTask task = null; synchronized (asyncTaskMap) {
@Override public void removeAsyncMessage(ConnectionContext context, MessageAck ack) throws IOException { if (isConcurrentStoreAndDispatchQueues()) { AsyncJobKey key = new AsyncJobKey(ack.getLastMessageId(), getDestination()); StoreQueueTask task = null; synchronized (asyncTaskMap) { task = (StoreQueueTask) asyncTaskMap.get(key); } if (task != null) { if (!task.cancel()) { try { task.future.get(); } catch (InterruptedException e) { throw new InterruptedIOException(e.toString()); } catch (Exception ignored) { LOG.debug("removeAsync: cannot cancel, waiting for add resulted in ex", ignored); } removeMessage(context, ack); } else { synchronized (asyncTaskMap) { asyncTaskMap.remove(key); } } } else { removeMessage(context, ack); } } else { removeMessage(context, ack); } }
@Override public void acknowledge(ConnectionContext context, String clientId, String subscriptionName, MessageId messageId, MessageAck ack) throws IOException { String subscriptionKey = subscriptionKey(clientId, subscriptionName).toString(); if (isConcurrentStoreAndDispatchTopics()) { AsyncJobKey key = new AsyncJobKey(messageId, getDestination()); StoreTopicTask task = null; synchronized (asyncTaskMap) { task = (StoreTopicTask) asyncTaskMap.get(key); } if (task != null) { if (task.addSubscriptionKey(subscriptionKey)) { removeTopicTask(this, messageId); if (task.cancel()) { synchronized (asyncTaskMap) { asyncTaskMap.remove(key); } } } } else { doAcknowledge(context, subscriptionKey, messageId, ack); } } else { doAcknowledge(context, subscriptionKey, messageId, ack); } }
public void acknowledge(ConnectionContext context, String clientId, String subscriptionName, MessageId messageId, MessageAck ack) throws IOException { String subscriptionKey = subscriptionKey(clientId, subscriptionName); if (isConcurrentStoreAndDispatchTopics()) { AsyncJobKey key = new AsyncJobKey(messageId, getDestination()); StoreTopicTask task = null; synchronized (asyncTaskMap) { task = (StoreTopicTask) asyncTaskMap.get(key); } if (task != null) { if (task.addSubscriptionKey(subscriptionKey)) { removeTopicTask(this, messageId); if (task.cancel()) { synchronized (asyncTaskMap) { asyncTaskMap.remove(key); } } } } else { doAcknowledge(context, subscriptionKey, messageId, ack); } } else { doAcknowledge(context, subscriptionKey, messageId, ack); } }
@Override public void acknowledge(ConnectionContext context, String clientId, String subscriptionName, MessageId messageId, MessageAck ack) throws IOException { String subscriptionKey = subscriptionKey(clientId, subscriptionName).toString(); if (isConcurrentStoreAndDispatchTopics()) { AsyncJobKey key = new AsyncJobKey(messageId, getDestination()); StoreTopicTask task = null; synchronized (asyncTaskMap) { task = (StoreTopicTask) asyncTaskMap.get(key); } if (task != null) { if (task.addSubscriptionKey(subscriptionKey)) { removeTopicTask(this, messageId); if (task.cancel()) { synchronized (asyncTaskMap) { asyncTaskMap.remove(key); } } } } else { doAcknowledge(context, subscriptionKey, messageId, ack); } } else { doAcknowledge(context, subscriptionKey, messageId, ack); } }
@Override public void acknowledge(ConnectionContext context, String clientId, String subscriptionName, MessageId messageId, MessageAck ack) throws IOException { String subscriptionKey = subscriptionKey(clientId, subscriptionName).toString(); if (isConcurrentStoreAndDispatchTopics()) { AsyncJobKey key = new AsyncJobKey(messageId, getDestination()); StoreTopicTask task = null; synchronized (asyncTaskMap) { task = (StoreTopicTask) asyncTaskMap.get(key); } if (task != null) { if (task.addSubscriptionKey(subscriptionKey)) { removeTopicTask(this, messageId); if (task.cancel()) { synchronized (asyncTaskMap) { asyncTaskMap.remove(key); } } } } else { doAcknowledge(context, subscriptionKey, messageId, ack); } } else { doAcknowledge(context, subscriptionKey, messageId, ack); } }
protected void addQueueTask(KahaDBMessageStore store, StoreQueueTask task) throws IOException { store.asyncTaskMap.put(new AsyncJobKey(task.getMessage().getMessageId(), store.getDestination()), task); this.queueExecutor.execute(task); }
protected void addQueueTask(KahaDBMessageStore store, StoreQueueTask task) throws IOException { store.asyncTaskMap.put(new AsyncJobKey(task.getMessage().getMessageId(), store.getDestination()), task); this.queueExecutor.execute(task); }
protected StoreTopicTask removeTopicTask(KahaDBTopicMessageStore store, MessageId id) { StoreTopicTask task = null; synchronized (store.asyncTaskMap) { task = (StoreTopicTask) store.asyncTaskMap.remove(new AsyncJobKey(id, store.getDestination())); } return task; }
protected StoreQueueTask removeQueueTask(KahaDBMessageStore store, MessageId id) { StoreQueueTask task = null; synchronized (store.asyncTaskMap) { task = (StoreQueueTask) store.asyncTaskMap.remove(new AsyncJobKey(id, store.getDestination())); } return task; }
protected void addTopicTask(KahaDBTopicMessageStore store, StoreTopicTask task) throws IOException { synchronized (store.asyncTaskMap) { store.asyncTaskMap.put(new AsyncJobKey(task.getMessage().getMessageId(), store.getDestination()), task); } this.topicExecutor.execute(task); }
protected StoreQueueTask removeQueueTask(KahaDBMessageStore store, MessageId id) { StoreQueueTask task = null; synchronized (store.asyncTaskMap) { task = (StoreQueueTask) store.asyncTaskMap.remove(new AsyncJobKey(id, store.getDestination())); } return task; }
protected void addQueueTask(KahaDBMessageStore store, StoreQueueTask task) throws IOException { store.asyncTaskMap.put(new AsyncJobKey(task.getMessage().getMessageId(), store.getDestination()), task); this.queueExecutor.execute(task); }
protected void addTopicTask(KahaDBTopicMessageStore store, StoreTopicTask task) throws IOException { synchronized (store.asyncTaskMap) { store.asyncTaskMap.put(new AsyncJobKey(task.getMessage().getMessageId(), store.getDestination()), task); } this.topicExecutor.execute(task); }
protected StoreTopicTask removeTopicTask(KahaDBTopicMessageStore store, MessageId id) { StoreTopicTask task = null; synchronized (store.asyncTaskMap) { task = (StoreTopicTask) store.asyncTaskMap.remove(new AsyncJobKey(id, store.getDestination())); } return task; }
protected StoreQueueTask removeQueueTask(KahaDBMessageStore store, MessageId id) { StoreQueueTask task = null; synchronized (store.asyncTaskMap) { task = (StoreQueueTask) store.asyncTaskMap.remove(new AsyncJobKey(id, store.getDestination())); } return task; }
protected StoreQueueTask removeQueueTask(KahaDBMessageStore store, MessageId id) { StoreQueueTask task = null; synchronized (store.asyncTaskMap) { task = (StoreQueueTask) store.asyncTaskMap.remove(new AsyncJobKey(id, store.getDestination())); } return task; }