protected void configure(ActiveMQMessage msg) throws JMSException { long sequenceNumber = messageSequence.incrementAndGet(); msg.setMessageId(new MessageId(producerId, sequenceNumber)); msg.onSend(); msg.setProducerId(producerId); }
msg.setMessageId(messageId); msg.onSend(); msg.setProducerId(msg.getMessageId().getProducerId());
message.setProducerId(duplexInboundLocalProducerInfo.getProducerId()); if (message.isResponseRequired() || configuration.isAlwaysSyncSend()) { duplexInboundLocalBroker.asyncRequest(message, new ResponseCallback() {
msg.setProducerId(msg.getMessageId().getProducerId()); if (LOG.isTraceEnabled()) { LOG.trace(getSessionId() + " sending message: " + msg);
advisoryMessage.setDestination(topic); advisoryMessage.setResponseRequired(false); advisoryMessage.setProducerId(advisoryProducerId); boolean originalFlowControl = context.isProducerFlowControl(); final ProducerBrokerExchange producerExchange = new ProducerBrokerExchange();
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); }
void onMQTTPublish(PUBLISH command) throws IOException, JMSException { checkConnected(); LOG.trace("MQTT Rcv PUBLISH message:{} client:{} connection:{}", command.messageId(), clientId, connectionInfo.getConnectionId()); ActiveMQMessage message = convertMessage(command); message.setProducerId(producerId); message.onSend(); sendToActiveMQ(message, createResponseHandler(command)); }
void onMQTTPublish(PUBLISH command) throws IOException, JMSException { checkConnected(); LOG.trace("MQTT Rcv PUBLISH message:{} client:{} connection:{}", command.messageId(), clientId, connectionInfo.getConnectionId()); ActiveMQMessage message = convertMessage(command); message.setProducerId(producerId); message.onSend(); sendToActiveMQ(message, createResponseHandler(command)); }
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 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 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 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)); }
void onMQTTPublish(PUBLISH command) throws IOException, JMSException { checkConnected(); LOG.trace("MQTT Rcv PUBLISH message:{} client:{} connection:{}", command.messageId(), clientId, connectionInfo.getConnectionId()); //Both version 3.1 and 3.1.1 do not allow the topic name to contain a wildcard in the publish packet if (containsMqttWildcard(command.topicName().toString())) { // [MQTT-3.3.2-2]: The Topic Name in the PUBLISH Packet MUST NOT contain wildcard characters getMQTTTransport().onException(IOExceptionSupport.create("The topic name must not contain wildcard characters.", null)); return; } ActiveMQMessage message = convertMessage(command); message.setProducerId(producerId); message.onSend(); sendToActiveMQ(message, createResponseHandler(command)); }
void onMQTTPublish(PUBLISH command) throws IOException, JMSException { checkConnected(); LOG.trace("MQTT Rcv PUBLISH message:{} client:{} connection:{}", command.messageId(), clientId, connectionInfo.getConnectionId()); //Both version 3.1 and 3.1.1 do not allow the topic name to contain a wildcard in the publish packet if (containsMqttWildcard(command.topicName().toString())) { // [MQTT-3.3.2-2]: The Topic Name in the PUBLISH Packet MUST NOT contain wildcard characters getMQTTTransport().onException(IOExceptionSupport.create("The topic name must not contain wildcard characters.", null)); return; } ActiveMQMessage message = convertMessage(command); message.setProducerId(producerId); message.onSend(); sendToActiveMQ(message, createResponseHandler(command)); }
void onMQTTPublish(PUBLISH command) throws IOException, JMSException { checkConnected(); LOG.trace("MQTT Rcv PUBLISH message:{} client:{} connection:{}", command.messageId(), clientId, connectionInfo.getConnectionId()); //Both version 3.1 and 3.1.1 do not allow the topic name to contain a wildcard in the publish packet if (containsMqttWildcard(command.topicName().toString())) { // [MQTT-3.3.2-2]: The Topic Name in the PUBLISH Packet MUST NOT contain wildcard characters getMQTTTransport().onException(IOExceptionSupport.create("The topic name must not contain wildcard characters.", null)); return; } ActiveMQMessage message = convertMessage(command); message.setProducerId(producerId); message.onSend(); sendToActiveMQ(message, createResponseHandler(command)); }
public void onTransportError() { if (connect != null) { if (connected.get()) { if (connect.willTopic() != null && connect.willMessage() != null && !willSent) { willSent = true; try { PUBLISH publish = new PUBLISH(); publish.topicName(connect.willTopic()); publish.qos(connect.willQos()); publish.messageId(MQTTPacketIdGenerator.getNextSequenceId(getClientId())); publish.payload(connect.willMessage()); ActiveMQMessage message = convertMessage(publish); message.setProducerId(producerId); message.onSend(); sendToActiveMQ(message, null); } catch (Exception e) { LOG.warn("Failed to publish Will Message " + connect.willMessage()); } } // remove connection info sendToActiveMQ(connectionInfo.createRemoveCommand(), null); } } }