# STOMP

## Streaming Text Oriented Messaging Protocol

More info at [Wikipedia: Streaming Text Oriented Messaging Protocol](https://en.wikipedia.org/wiki/Streaming_Text_Oriented_Messaging_Protocol)

---

**⚠️ Proxy Configuration**: If your server accesses the internet through a proxy, ensure that the **STOMP** domains are whitelisted.

---

### JMSTask configuration:

#### JNDI config: Variable replacement is supported.

More info about **Java Naming and Directory Interface**: [Wikipedia: Java Naming and Directory Interface Link](https://en.wikipedia.org/wiki/Java_Naming_and_Directory_Interface)\
**JNDI** is a system used by some applications to store and access connection details—like the server address, username, and password—as well as the names of messaging channels (called **topics** and **queues**).In simple terms, it helps the application know where to connect and where to send or receive messages, without needing to hard-code those details every time.

![Stomp jndi config](STOMP/stomp_jndi_config.png)

**STOMP TCP TLS Configuration example**:

```
# Secured STOMP TCP Host 
url=stomp+ssl://my.stomp.domain.com:61619

#User name and password
username=user
password=password
#Topic name
topic.lmint_topic=lmint_topic
heartbeat_interval=5000
log_stomp_command_header=true
```

**STOMP WSS Configuration example**:

```
# Secured STOMP WSS Host 
url=stomp+wss://my.stomp.domain.com:61619

#User name and password
username=user
password=password
#Topic name
topic.lmint_topic=lmint_topic
heartbeat_interval=5000
log_stomp_command_header=true
```

**url**: Defines the connection endpoint for the Message Broker.

\- **stomp+ssl**: STOMP messages through a driect TCP connection wrapped in SSL/TLS encryption\
\- **stomp+wss**: STOMP messages through a Secure WebSocket (WSS), wrapping the traffic in SSL/TLS

**username=user or password=password**: The authentication credentials required to log in to the Message Broker. The account used here must have permissions to connect to the broker and specifically to publish or subscribe to the topics defined below.

**topic.lmint_topic=lmint_topic**: Defines the specific destination (Topic/Queue) on the broker where messages will be sent or received.

**heartbeat_interval=5000**: The frequency of **keep-alive** signals sent between the client and the server to maintain the connection.

**log_stomp_command_header=true**: Controls the verbosity of the STOMP protocol logging. When set to true, the application writes the raw headers of every outgoing STOMP frame.

---

#### Producer Mode: See at [Producer Mode Link](JMSTask-Producer-Mode.md)

---

#### Consumer Mode: See at [Consumer Mode Link](JMSTAsk-Consumer-Mode.md)

---

Back to: [JMS (Java Message Service)](JMS-Java-Message-Service.md)

---
