Package org.chenile.mqtt.entry
Class MqttEntryPoint
java.lang.Object
org.chenile.mqtt.entry.MqttEntryPoint
The entry point that is invoked by the Mqtt subscriber when a message arrives at a topic.
This translates the message into a service invocation.
The return value from the service is either published back to a reply queue (if one is specified)
or just discarded if none is specified. However, errors will be logged.
- Author:
- Raja Shankar Kolluru
-
Field Summary
Modifier and TypeFieldDescriptionprivate ChenileConfiguration
(package private) ChenileEntryPoint
private static final org.slf4j.Logger
private final ObjectMapper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate ChenileExchange
makeExchange
(String topic) topic will be in the format /some/stuff/serviceName/operationName extract the service name and operation name from the topicprivate void
populateHeaders
(org.eclipse.paho.mqttv5.common.MqttMessage message, ChenileExchange exchange) void
The entry point for MQ-TT.
-
Field Details
-
logger
private static final org.slf4j.Logger logger -
chenileConfiguration
-
mqttConfig
-
chenileEntryPoint
-
objectMapper
-
-
Constructor Details
-
MqttEntryPoint
public MqttEntryPoint()
-
-
Method Details
-
process
public void process(String topic, org.eclipse.paho.mqttv5.common.MqttMessage message) throws Exception The entry point for MQ-TT. It puts the message into the system and extracts the response which is logged. We support asynchronous messages at this point in time.- Parameters:
topic
- the topic where the message was receivedmessage
- the message that was received- Throws:
Exception
- if there is a problem in processing the message
-
populateHeaders
private void populateHeaders(org.eclipse.paho.mqttv5.common.MqttMessage message, ChenileExchange exchange) -
makeExchange
topic will be in the format /some/stuff/serviceName/operationName extract the service name and operation name from the topic- Parameters:
topic
- the topic that received this message. Used to compute service and op name- Returns:
- the exchange
-