/** * @return a new object instance */ public DataStructure createObject() { return new MessageId(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageId(); }
public MessageId copy() { MessageId copy = new MessageId(producerId, producerSequenceId); copy.key = key; copy.brokerSequenceId = brokerSequenceId; copy.dataLocator = dataLocator; copy.entryLocator = entryLocator; copy.futureOrSequenceLong = futureOrSequenceLong; copy.plistLocator = plistLocator; copy.textView = textView; return copy; }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageId(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageId(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageId(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageId(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageId(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageId(); }
/** * @return a new object instance */ public DataStructure createObject() { return new MessageId(); }
@Override public boolean recoverMessageReference(String reference) throws Exception { return listener.recoverMessageReference(new MessageId(reference)); }
@Override public boolean recoverMessageReference(String reference) throws Exception { return delegate.recoverMessageReference(new MessageId(reference)); }
@Override public boolean recoverMessageReference(String reference) throws Exception { if (listener.hasSpace()) { return listener.recoverMessageReference(new MessageId(reference)); } else { if (LOG.isTraceEnabled()) { LOG.trace("Message recovery limit reached for MessageRecoveryListener"); } return false; } } });
@Override public boolean recoverMessageReference(String reference) throws Exception { if (listener.hasSpace()) { listener.recoverMessageReference(new MessageId(reference)); return true; } return false; }
/** * This will create an object of MessageId. For it to be valid, the instance * variable ProducerId and producerSequenceId must be initialized. * * @param producerId * @param producerSequenceId * @throws JMSException */ public void setJMSMessageID(ProducerId producerId, long producerSequenceId) throws JMSException { MessageId id = null; try { id = new MessageId(producerId, producerSequenceId); this.setMessageId(id); } catch (Throwable e) { throw JMSExceptionSupport.create("Invalid message id '" + id + "', reason: " + e.getMessage(), e); } }
protected void configure(ActiveMQMessage msg) throws JMSException { long sequenceNumber = messageSequence.incrementAndGet(); msg.setMessageId(new MessageId(producerId, sequenceNumber)); msg.onSend(); msg.setProducerId(producerId); }
@Override public void doMessageIdScan(TransactionContext c, int limit, JDBCMessageIdScanListener listener) throws SQLException, IOException { PreparedStatement s = null; ResultSet rs = null; try { s = c.getConnection().prepareStatement(this.statements.getFindAllMessageIdsStatement()); s.setMaxRows(limit); rs = s.executeQuery(); // jdbc scrollable cursor requires jdbc ver > 1.0 and is often implemented locally so avoid LinkedList<MessageId> reverseOrderIds = new LinkedList<MessageId>(); while (rs.next()) { reverseOrderIds.addFirst(new MessageId(rs.getString(2), rs.getLong(3))); } if (LOG.isDebugEnabled()) { LOG.debug("messageIdScan with limit (" + limit + "), resulted in: " + reverseOrderIds.size() + " ids"); } for (MessageId id : reverseOrderIds) { listener.messageId(id); } } finally { close(rs); close(s); } }
/** * Seems to be invalid because the parameter doesn't initialize MessageId * instance variables ProducerId and ProducerSequenceId * * @param value * @throws JMSException */ @Override public void setJMSMessageID(String value) throws JMSException { if (value != null) { try { MessageId id = new MessageId(value); this.setMessageId(id); } catch (NumberFormatException e) { // we must be some foreign JMS provider or strange user-supplied // String // so lets set the IDs to be 1 MessageId id = new MessageId(); id.setTextView(value); this.setMessageId(id); } } else { this.setMessageId(null); } }
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); } }
protected void sendStats(ConnectionContext context, ActiveMQMapMessage msg, ActiveMQDestination replyTo) throws Exception { msg.setPersistent(false); msg.setTimestamp(System.currentTimeMillis()); msg.setPriority((byte) javax.jms.Message.DEFAULT_PRIORITY); msg.setType(AdvisorySupport.ADIVSORY_MESSAGE_TYPE); msg.setMessageId(new MessageId(this.advisoryProducerId, this.messageIdGenerator.getNextSequenceId())); msg.setDestination(replyTo); msg.setResponseRequired(false); msg.setProducerId(this.advisoryProducerId); boolean originalFlowControl = context.isProducerFlowControl(); final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange(); producerExchange.setConnectionContext(context); producerExchange.setMutable(true); producerExchange.setProducerState(new ProducerState(new ProducerInfo())); try { context.setProducerFlowControl(false); this.next.send(producerExchange, msg); } finally { context.setProducerFlowControl(originalFlowControl); } }