# AMQP

---

## Advanced Message Queuing Protocol

More info at [Wikipedia: Advanced Message Queuing Protocol Link](https://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol)

---

**⚠️ Important**:\
• Dependency jar files must be downloaded (unzip) and placed in your **CrushFTP Install Folder/plugins/ lib**. ⚠️ Restart is required to load the new JMS-related dependency jars. [Download Link](JMS-Java-Message-Service/jms_dependency.zip)\
• CrushFTP’s JMSTask supports JMS providers that use the **AMQP 1.0** protocol.

---

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

---

### 1. Solace JMS Integration

More info about Solace JMS AMQP: [Why Solace Support for AMQP 1.0? Link](https://docs.solace.com/API/AMQP/Why-AMQP.htm)

Get the **AMQPS URL**, **username**, and **password** from your Solace broker for use in the JMSTask JNDI configuration.

![Jms amqp](JMS-Java-Message-Service/jms_amqp.png)

---

### 2. Apache ActiveMQ Artemis and Amazon MQ Integration

#### 2.1 Apache ActiveMQ Artemis

More info: [ActiveMQ Artemis Documentation Link](https://activemq.apache.org/components/artemis/documentation/)\
**⚠️ Important**: To connect JMSTask to **Apache ActiveMQ Artemis** over **AMQPS**, ensure your Artemis broker is configured to accept secure **AMQP** connections.

![Apache artemis](JMS-Java-Message-Service/apache_artemis.png)

**JNDI connection related settings example:**

---

**a.)**

```
# Secured AMQP Host 
connectionfactory.qpidConnectionfactory=amqps://192.168.0.10:5671?transport.trustAll=true&transport.verifyHost=false
```

• **transport.trustAll=true** -> Accepts all SSL certificates.\
• **transport.verifyHost=false** -> Disables hostname verification in the TLS handshake.

---

**b.)**

```
# Secured AMQP Host 
connectionfactory.qpidConnectionfactory=amqps://my.artemis.com:5671
```

---

#### 2.2 Amazon MQ Integration

CrushFTP also supports integration with **Amazon MQ**, a managed message broker service compatible with ActiveMQ and Artemis. [Amazon MQ (official site) Link](https://aws.amazon.com/amazon-mq/) More info: [Amazon MQ – Managed Message Broker Service for ActiveMQ Link](https://aws.amazon.com/blogs/aws/amazon-mq-managed-message-broker-service-for-activemq/)

Sign in to **AWS Console** and Navigate to **Amazon MQ** Select your Broker. Click on the name of your ActiveMQ or Artemis broker. Scroll down to the **Connections** section.

![Amazon amqps url](JMS-Java-Message-Service/amazon_amqps_url.png)

```
amqps://<broker-id>.mq.<region>.amazonaws.com:5671
```

---

### 3 Azure Service Bus Integration:

[Azure Service Bus Link](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-overview)\
[AMQP 1.0 in Azure Service Bus and Event Hubs protocol guide Link](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-amqp-overview)\
![Azure service bus](JMS-Java-Message-Service/azure_service_bus.png)

To get **AMQPS URL**:\
**a.)** Open your **Service Bus namespace** in the **Azure Portal**\
**b.)** Go to Settings → Shared access policies\
**c.)** Select a policy (e.g., RootManageSharedAccessKey)\
**d.)** Copy the namespace name (e.g., your-namespace.servicebus.windows.net)\
**e.)** Combine as amqps://your-namespace.servicebus.windows.net:5671

![Azure amqps shared access key](JMS-Java-Message-Service/azure_amqps_shared_access_key.png)

```
amqps://<namespace>.servicebus.windows.net:5671
username = <SAS-key-name>
password = <SAS-key>
```

---

### 4. JMSTask configuration:

#### 4.1 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.

![Jms jndi config](JMS-Java-Message-Service/jms_jndi_config.png)

Configuration example:

```
# Context Factory (Do not change!)
java.naming.factory.initial=org.apache.qpid.jms.jndi.JmsInitialContextFactory

# Secured AMQP Host 
connectionfactory.qpidConnectionfactory=amqps://mr-connection-XXXXd:56XX

#User name and password
username=solace-XXXX
password=rsaXXXXXX
#Topic name
topic.my_topic_name=my_topic_name
queue.my_queue=my_queue
```

**java.naming.factory.initial=org.apache.qpid.jms.jndi.JmsInitialContextFactory:** This tells the application which type of messaging system it is connecting to. ⚠️ Do not change!

**connectionfactory.qpidConnectionfactory=amqps://mr-connection-XXXXd:56XX** or\
**connectionfactory.qpidConnectionfactory=amqps://mr-connection-XXXXd:56XX?transport.trustAll=true&transport.verifyHost=false**\
This is the secure address of the messaging server (uses AMQPS, which is encrypted). It tells the application where to connect to send and receive messages.

**⚠️ Important**: JMSTask uses **sasl.enabled.mechanisms=PLAIN** by default.\
**username=solace-XXXX password=rsaXXXXXX**: These are the login credentials used to access the messaging server.

**topic.my_topic_name=my_topic_name**: A topic is a named channel where messages are published. Applications can subscribe to this topic to receive relevant messages.\
**queue.my_queue=my_queue**: A queue is another type of message destination. Unlike topics, queues hold messages until they are delivered to a specific recipient.

---

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

---

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

---

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

---
