/** * 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); } }
/** * 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); }
msg.setJMSPriority(priority); msg.setJMSRedelivered(false); msg.setMessageId(messageId); msg.onSend(); msg.setProducerId(msg.getMessageId().getProducerId());
msg.setMessageId(new MessageId(producer.getProducerInfo().getProducerId(), sequenceNumber));
advisoryMessage.setPersistent(false); advisoryMessage.setType(AdvisorySupport.ADIVSORY_MESSAGE_TYPE); advisoryMessage.setMessageId(new MessageId(advisoryProducerId, messageIdGenerator.getNextSequenceId())); advisoryMessage.setTargetConsumerId(targetConsumerId); advisoryMessage.setDestination(topic);
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * 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); }
protected void configure(ActiveMQMessage msg) throws JMSException { long sequenceNumber = messageSequence.incrementAndGet(); msg.setMessageId(new MessageId(producerId, sequenceNumber)); msg.onSend(); msg.setProducerId(producerId); }
protected void configure(ActiveMQMessage msg) throws JMSException { long sequenceNumber = messageSequence.incrementAndGet(); msg.setMessageId(new MessageId(producerId, sequenceNumber)); msg.onSend(); msg.setProducerId(producerId); }
protected void configure(ActiveMQMessage msg) throws JMSException { long sequenceNumber = messageSequence.incrementAndGet(); msg.setMessageId(new MessageId(producerId, sequenceNumber)); msg.onSend(); msg.setProducerId(producerId); }
protected void onStompSend(StompFrame command) throws IOException, JMSException { checkConnected(); Map<String, String> headers = command.getHeaders(); String destination = headers.get(Stomp.Headers.Send.DESTINATION); if (destination == null) { throw new ProtocolException("SEND received without a Destination specified!"); } String stompTx = headers.get(Stomp.Headers.TRANSACTION); headers.remove("transaction"); ActiveMQMessage message = convertMessage(command); message.setProducerId(producerId); MessageId id = new MessageId(producerId, messageIdGenerator.getNextSequenceId()); message.setMessageId(id); if (stompTx != null) { TransactionId activemqTx = transactions.get(stompTx); if (activemqTx == null) { throw new ProtocolException("Invalid transaction id: " + stompTx); } message.setTransactionId(activemqTx); } message.onSend(); sendToActiveMQ(message, createResponseHandler(command)); }
protected void onMessage(Message message) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug("Message from: " + message.getFrom() + " to: " + message.getTo() + " subjectOrBodyOrThread: " + message.getSubjectOrBodyOrThread()); } final ActiveMQMessage activeMQMessage = createActiveMQMessage(message); ActiveMQDestination destination = createActiveMQDestination(message.getTo()); activeMQMessage.setMessageId(new MessageId(producerInfo, messageIdGenerator.getNextSequenceId())); activeMQMessage.setDestination(destination); activeMQMessage.setProducerId(producerId); activeMQMessage.setTimestamp(System.currentTimeMillis()); addActiveMQMessageHeaders(activeMQMessage, message); /* * MessageDispatch dispatch = new MessageDispatch(); * dispatch.setDestination(destination); * dispatch.setMessage(activeMQMessage); */ if (LOG.isDebugEnabled()) { LOG.debug("Sending ActiveMQ message: " + activeMQMessage); } sendToActiveMQ(activeMQMessage, createErrorHandler("send message")); }
protected void onStompSend(StompFrame command) throws IOException, JMSException { checkConnected(); Map<String, String> headers = command.getHeaders(); String stompTx = headers.get(Stomp.Headers.TRANSACTION); headers.remove("transaction"); ActiveMQMessage message = convertMessage(command); message.setProducerId(producerId); MessageId id = new MessageId(producerId, messageIdGenerator.getNextSequenceId()); message.setMessageId(id); message.setJMSTimestamp(System.currentTimeMillis()); if (stompTx != null) { TransactionId activemqTx = transactions.get(stompTx); if (activemqTx == null) { throw new ProtocolException("Invalid transaction id: " + stompTx); } message.setTransactionId(activemqTx); } message.onSend(); sendToActiveMQ(message, createResponseHandler(command)); }
protected void onStompSend(StompFrame command) throws IOException, JMSException { checkConnected(); Map<String, String> headers = command.getHeaders(); String destination = headers.get(Stomp.Headers.Send.DESTINATION); if (destination == null) { throw new ProtocolException("SEND received without a Destination specified!"); } String stompTx = headers.get(Stomp.Headers.TRANSACTION); headers.remove("transaction"); ActiveMQMessage message = convertMessage(command); message.setProducerId(producerId); MessageId id = new MessageId(producerId, messageIdGenerator.getNextSequenceId()); message.setMessageId(id); if (stompTx != null) { TransactionId activemqTx = transactions.get(stompTx); if (activemqTx == null) { throw new ProtocolException("Invalid transaction id: " + stompTx); } message.setTransactionId(activemqTx); } message.onSend(); message.beforeMarshall(null); sendToActiveMQ(message, createResponseHandler(command)); }
protected void onStompSend(StompFrame command) throws IOException, JMSException { checkConnected(); Map<String, String> headers = command.getHeaders(); String destination = headers.get(Stomp.Headers.Send.DESTINATION); if (destination == null) { throw new ProtocolException("SEND received without a Destination specified!"); } String stompTx = headers.get(Stomp.Headers.TRANSACTION); headers.remove("transaction"); ActiveMQMessage message = convertMessage(command); message.setProducerId(producerId); MessageId id = new MessageId(producerId, messageIdGenerator.getNextSequenceId()); message.setMessageId(id); if (stompTx != null) { TransactionId activemqTx = transactions.get(stompTx); if (activemqTx == null) { throw new ProtocolException("Invalid transaction id: " + stompTx); } message.setTransactionId(activemqTx); } message.onSend(); message.beforeMarshall(null); sendToActiveMQ(message, createResponseHandler(command)); }