@Override public void fail(Object msgId) { final KestrelSourceId sourceId = (KestrelSourceId) msgId; final KestrelClientInfo info = _kestrels.get(sourceId.index); // see not above about why this works with blacklisting strategy try { if (info.client != null) { final HashSet<Long> xids = new HashSet<Long>(); xids.add(sourceId.id); info.client.abort(_queueName, xids); } } catch (final TException e) { blacklist(info, e); } }
@Override public void fail(Object msgId) { final KestrelSourceId sourceId = (KestrelSourceId) msgId; final KestrelClientInfo info = _kestrels.get(sourceId.index); // see not above about why this works with blacklisting strategy try { if (info.client != null) { final HashSet<Long> xids = new HashSet<Long>(); xids.add(sourceId.id); info.client.abort(_queueName, xids); } } catch (final TException e) { blacklist(info, e); } }
@Override public void ack(Object msgId) { final KestrelSourceId sourceId = (KestrelSourceId) msgId; final KestrelClientInfo info = _kestrels.get(sourceId.index); // if the transaction didn't exist, it just returns false. so this code // works // even if client gets blacklisted, disconnects, and kestrel puts the // item // back on the queue try { if (info.client != null) { final HashSet<Long> xids = new HashSet<Long>(); xids.add(sourceId.id); info.client.confirm(_queueName, xids); } } catch (final TException e) { blacklist(info, e); } }
@Override public void ack(Object msgId) { final KestrelSourceId sourceId = (KestrelSourceId) msgId; final KestrelClientInfo info = _kestrels.get(sourceId.index); // if the transaction didn't exist, it just returns false. so this code // works // even if client gets blacklisted, disconnects, and kestrel puts the // item // back on the queue try { if (info.client != null) { final HashSet<Long> xids = new HashSet<Long>(); xids.add(sourceId.id); info.client.confirm(_queueName, xids); } } catch (final TException e) { blacklist(info, e); } }