/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { MessageAck info = (MessageAck)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); dataOut.writeByte(info.getAckType()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getFirstMessageId(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getLastMessageId(), dataOut); dataOut.writeInt(info.getMessageCount()); } }
@Override public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Acknowledging message for client ID: {}{}", consumerExchange.getConnectionContext().getClientId(), (ack.getMessageCount() == 1 ? ", " + ack.getLastMessageId() : "")); if (ack.getMessageCount() > 1) { LOG.trace("Message count: {}, First Message Id: {}, Last Message Id: {}", new Object[]{ ack.getMessageCount(), ack.getFirstMessageId(), ack.getLastMessageId() }); } } super.acknowledge(consumerExchange, ack); }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { MessageAck info = (MessageAck)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getFirstMessageId(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getLastMessageId(), bs); return rc + 5; }
MessageAck ma = (MessageAck)bc; sb.append(" ConsumerID:"); sb.append(ma.getConsumerId()); sb.append(" ack:"); sb.append(ma.getFirstMessageId()); sb.append('-'); sb.append(ma.getLastMessageId());
@Override public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException { KahaRemoveMessageCommand command = new KahaRemoveMessageCommand(); command.setDestination(dest); command.setMessageId(ack.getLastMessageId().toProducerKey()); processRemove(command, ack.getTransactionId()); }
pendingAck.setTransactionId(session.getTransactionContext().getTransactionId()); if( oldPendingAck==null ) { pendingAck.setFirstMessageId(pendingAck.getLastMessageId()); } else if ( oldPendingAck.getAckType() == pendingAck.getAckType() ) { pendingAck.setFirstMessageId(oldPendingAck.getFirstMessageId()); } else {
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { MessageAck info = (MessageAck)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); dataOut.writeByte(info.getAckType()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getFirstMessageId(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getLastMessageId(), dataOut); dataOut.writeInt(info.getMessageCount()); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { MessageAck info = (MessageAck)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getFirstMessageId(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getLastMessageId(), bs); return rc + 5; }
MessageId firstAckedMsg = ack.getFirstMessageId(); MessageId lastAckedMsg = ack.getLastMessageId(); int checkCount = 0; boolean checkFoundStart = false; + "; Could not find Message-ID " + lastAckedMsg + " in dispatched-list (end of ack)"); if (ack.getMessageCount() != checkCount && !ack.isInTransaction()) { throw new JMSException("Unmatched acknowledge: " + ack + "; Expected message count (" + ack.getMessageCount() + ") differs from count in dispatched-list (" + checkCount + ")");
@Override public void removeMessage(ConnectionContext context, MessageAck ack) throws IOException { KahaRemoveMessageCommand command = new KahaRemoveMessageCommand(); command.setDestination(dest); command.setMessageId(ack.getLastMessageId().toProducerKey()); command.setTransactionInfo(TransactionIdConversion.convert(transactionIdTransformer.transform(ack.getTransactionId()))); org.apache.activemq.util.ByteSequence packet = wireFormat.marshal(ack); command.setAck(new Buffer(packet.getData(), packet.getOffset(), packet.getLength())); store(command, isEnableJournalDiskSyncs() && ack.isResponseRequired(), null, null); }
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { MessageAck info = (MessageAck)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); dataOut.writeByte(info.getAckType()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getFirstMessageId(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getLastMessageId(), dataOut); dataOut.writeInt(info.getMessageCount()); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { MessageAck info = (MessageAck)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getFirstMessageId(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getLastMessageId(), bs); return rc + 5; }
for (final DispatchedNode node : dispatched) { MessageId messageId = node.getMessageId(); if (ack.getFirstMessageId() == null || ack.getFirstMessageId().equals(messageId)) { inAckRange = true; if (ack.getLastMessageId().equals(messageId)) { break; incrementStatsOnAck(destination, ack, ack.getMessageCount()); contractPrefetchExtension(ack.getMessageCount());
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { MessageAck info = (MessageAck)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); dataOut.writeByte(info.getAckType()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getFirstMessageId(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getLastMessageId(), dataOut); dataOut.writeInt(info.getMessageCount()); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { MessageAck info = (MessageAck)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getFirstMessageId(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getLastMessageId(), bs); return rc + 5; }
if (ack.getLastMessageId().equals(messageId)) { destination = (Destination) node.getRegionDestination(); callDispatchMatched = true; if (ack.getLastMessageId().equals(messageId)) { final MessageReference node = iter.next(); Destination nodeDest = (Destination) node.getRegionDestination(); if (ack.getLastMessageId().equals(node.getMessageId())) { expandPrefetchExtension(ack.getMessageCount()); destination = nodeDest; callDispatchMatched = true; nodeDest.getDestinationStatistics().getInflight().decrement(); if (ack.getLastMessageId().equals(messageId)) { contractPrefetchExtension(1); destination = (Destination) node.getRegionDestination(); if (ack.getLastMessageId().equals(messageId)) { destination = (Destination) node.getRegionDestination(); callDispatchMatched = true; index++; acknowledge(context, ack, node); if (ack.getLastMessageId().equals(messageId)) { contractPrefetchExtension(1); destination = nodeDest;
/** * Write the booleans that this object uses to a BooleanStream */ public void looseMarshal(OpenWireFormat wireFormat, Object o, DataOutput dataOut) throws IOException { MessageAck info = (MessageAck)o; super.looseMarshal(wireFormat, o, dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getDestination(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getTransactionId(), dataOut); looseMarshalCachedObject(wireFormat, (DataStructure)info.getConsumerId(), dataOut); dataOut.writeByte(info.getAckType()); looseMarshalNestedObject(wireFormat, (DataStructure)info.getFirstMessageId(), dataOut); looseMarshalNestedObject(wireFormat, (DataStructure)info.getLastMessageId(), dataOut); dataOut.writeInt(info.getMessageCount()); } }
/** * Write the booleans that this object uses to a BooleanStream */ public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { MessageAck info = (MessageAck)o; int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getConsumerId(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getFirstMessageId(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getLastMessageId(), bs); return rc + 5; }
@Override public void acknowledge(ConsumerBrokerExchange consumerExchange, MessageAck ack) throws Exception { if (isLogAll() || isLogConsumerEvents()) { LOG.info("Acknowledging message for client ID: {}{}", consumerExchange.getConnectionContext().getClientId(), (ack.getMessageCount() == 1 ? ", " + ack.getLastMessageId() : "")); if (ack.getMessageCount() > 1) { LOG.trace("Message count: {}, First Message Id: {}, Last Message Id: {}", new Object[]{ ack.getMessageCount(), ack.getFirstMessageId(), ack.getLastMessageId() }); } } super.acknowledge(consumerExchange, ack); }
/** * Write a object instance to data output stream * * @param o the instance to be marshaled * @param dataOut the output stream * @throws IOException thrown if an error occurs */ public void tightMarshal2(OpenWireFormat wireFormat, Object o, DataOutput dataOut, BooleanStream bs) throws IOException { super.tightMarshal2(wireFormat, o, dataOut, bs); MessageAck info = (MessageAck)o; tightMarshalCachedObject2(wireFormat, (DataStructure)info.getDestination(), dataOut, bs); tightMarshalCachedObject2(wireFormat, (DataStructure)info.getTransactionId(), dataOut, bs); tightMarshalCachedObject2(wireFormat, (DataStructure)info.getConsumerId(), dataOut, bs); dataOut.writeByte(info.getAckType()); tightMarshalNestedObject2(wireFormat, (DataStructure)info.getFirstMessageId(), dataOut, bs); tightMarshalNestedObject2(wireFormat, (DataStructure)info.getLastMessageId(), dataOut, bs); dataOut.writeInt(info.getMessageCount()); }