# Publish

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.RabbitMQ>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                     | Description                                                                                                                                                                                                                                               |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| InputType : `InputType`  | <p>Data input type.</p><p>Possible values:</p><ul><li><code>String</code>:</li></ul><p>Data input type.</p><ul><li><code>ByteArray</code>:</li></ul><p>Data input type.</p><p><br>Default: <code>-</code><br>Example: <code>String, Byte Array</code></p> |
| DataByteArray : `Byte[]` | <p>Data payload in byte array format.</p><p><br>Default: <code>-</code><br>Example: <code>54 65 73 74 20 6d 65 73 73 61 67 65</code></p>                                                                                                                  |
| DataString : `String`    | <p>Data payload in string format.</p><p><br>Default: <code>-</code><br>Example: <code>Test message</code></p>                                                                                                                                             |
| Headers : `Header[]`     | <p>List of headers to be added to the request.</p><p><br>Default: <code>-</code><br>Example: <code>foo, bar</code></p>                                                                                                                                    |
| {% endtab %}             |                                                                                                                                                                                                                                                           |

{% tab title="Parameter: Connection" %}

| Name                                                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Timeout : `Int32`                                     | <p>Timeout setting for connection attempts. Value 0 indicates that the default value for the attempts should be used. Set value in seconds.</p><p><br>Default: <code>60</code><br>Example: <code>60</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| AuthenticationMethod : `AuthenticationMethod`         | <p>Authentication method: URI, hostname with username/password, or certificate.</p><p>Possible values:</p><ul><li><code>URI</code>:</li></ul><p>Authentication method: URI, hostname with username/password, or certificate.</p><ul><li><code>Host</code>:</li></ul><p>Authentication method: URI, hostname with username/password, or certificate.</p><ul><li><code>Certificate</code>:</li></ul><p>Authentication method: URI, hostname with username/password, or certificate.</p><ul><li><code>CertificateWithCredentials</code>:</li></ul><p>Authentication method: URI, hostname with username/password, or certificate.</p><p><br>Default: <code>-</code><br>Example: <code>URI</code></p>                                                                                                                                                                                                             |
| 🗝Host : `String`                                     | <p>URI or hostname to connect to, depending of authentication method.</p><p><br>Default: <code>-</code><br>Example: <code>RabbitHost, amqp\://foo:bar\@localhost:1234</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Username : `String`                                   | <p>Username to use when authenticating to the server.</p><p><br>Default: <code>-</code><br>Example: <code>foo</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| 🗝Password : `String`                                 | <p>Password to use when authenticating to the server.</p><p><br>Default: <code>-</code><br>Example: <code>bar</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| Port : `Int32`                                        | <p>The port to connect on. Value 0 indicates that the default port for the protocol should be used.</p><p><br>Default: <code>-</code><br>Example: <code>0</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| SslProtocol : `SslProtocol`                           | <p>Specifies the SSL protocol used for the RabbitMQ connection. Use SslProtocol.None to allow the operating system to negotiate the most secure protocol available.</p><p>Possible values:</p><ul><li><code>None</code>:</li></ul><p>Specifies the SSL protocol used for the RabbitMQ connection. Use SslProtocol.None to allow the operating system to negotiate the most secure protocol available.</p><ul><li><code>Tls12</code>:</li></ul><p>Specifies the SSL protocol used for the RabbitMQ connection. Use SslProtocol.None to allow the operating system to negotiate the most secure protocol available.</p><ul><li><code>Tls13</code>:</li></ul><p>Specifies the SSL protocol used for the RabbitMQ connection. Use SslProtocol.None to allow the operating system to negotiate the most secure protocol available.</p><p><br>Default: <code>-</code><br>Example: <code>SslProtocol.None</code></p> |
| CertificateSource : `CertificateSource`               | <p>Specifies the source from which the client certificate should be loaded.</p><p>Possible values:</p><ul><li><code>File</code>:</li></ul><p>Specifies the source from which the client certificate should be loaded.</p><ul><li><code>Store</code>:</li></ul><p>Specifies the source from which the client certificate should be loaded.</p><ul><li><code>Base64</code>:</li></ul><p>Specifies the source from which the client certificate should be loaded.</p><ul><li><code>RawBytes</code>:</li></ul><p>Specifies the source from which the client certificate should be loaded.</p><p><br>Default: <code>-</code><br>Example: <code>CertificateSource.File</code></p>                                                                                                                                                                                                                                   |
| ClientCertificatePath : `String`                      | <p>Full file system path to a client certificate file (.pfx or .p12) used for TLS client‑certificate authentication.</p><p><br>Default: <code>-</code><br>Example: <code>C:\certs\client-auth.pfx</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| 🗝ClientCertificatePassword : `String`                | <p>Password required to decrypt the certificate file. Needed for password‑protected .pfx/.p12 certificates.</p><p><br>Default: <code>-</code><br>Example: <code>MyStrongPassword123!</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| 🗝CertificateBase64 : `String`                        | <p>Base64‑encoded representation of a client certificate (.pfx or .p12).</p><p><br>Default: <code>-</code><br>Example: <code>MIIF2wIBAzCCB...</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| 🗝CertificateBytes : `Byte[]`                         | <p>Raw byte array containing a client certificate (.pfx or .p12).</p><p><br>Default: <code>-</code><br>Example: <code>byte\[] { 1, 2, 3, 4, 5 }</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| StoreThumbprint : `String`                            | <p>Thumbprint of a certificate stored in the Windows certificate store.</p><p><br>Default: <code>-</code><br>Example: <code>ab12cd34ef56ab78cd90ef12ab34cd56ef7890ab</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| CertificateStoreLocation : `CertificateStoreLocation` | <p>Windows certificate store location to search when loading a certificate by thumbprint.</p><p>Possible values:</p><ul><li><code>LocalMachine</code>:</li></ul><p>Windows certificate store location to search when loading a certificate by thumbprint.</p><ul><li><code>CurrentUser</code>:</li></ul><p>Windows certificate store location to search when loading a certificate by thumbprint.</p><p><br>Default: <code>-</code><br>Example: <code>CertificateStoreLocation.CurrentUser</code></p>                                                                                                                                                                                                                                                                                                                                                                                                         |
| QueueName : `String`                                  | <p>The name of the queue. Leave empty to make the server generate a name.</p><p><br>Default: <code>-</code><br>Example: <code>SampleQueue</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ExchangeName : `String`                               | <p>Exchange's name.</p><p><br>Default: <code>-</code><br>Example: <code>SampleExchange</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| RoutingKey : `String`                                 | <p>Routing key's name.</p><p><br>Default: <code>-</code><br>Example: <code>route</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Create : `Boolean`                                    | <p>True to declare queue when publishing.</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| AutoDelete : `Boolean`                                | <p>Should this queue be auto-deleted when its last consumer (if any) unsubscribes?</p><p><br>Default: <code>False</code><br>Example: <code>false</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| Durable : `Boolean`                                   | <p>Should this queue will survive a broker restart?</p><p>Note that Quorum queue supports only Durable settings.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| Quorum : `Boolean`                                    | <p>Should this queue be a quorum queue.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| VirtualHost : `String`                                | <p>RabbitMQ virtual host to connect to.</p><p><br>Default: <code>/</code><br>Example: <code>/</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ConnectionExpirationSeconds : `Int32`                 | <p>Time in seconds how long a connection will be left open for reuse after the execution.</p><p><br>Default: <code>30</code><br>Example: <code>60</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| {% endtab %}                                          |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

{% tab title="Result: Result" %}

| Name                                   | Description                                                                                         |
| -------------------------------------- | --------------------------------------------------------------------------------------------------- |
| Success : `Boolean`                    | <p>Indicates if the task completed successfully.<br>Example: <code>true</code></p>                  |
| DataFormat : `String`                  | <p>Published data format.<br>Example: <code>String</code></p>                                       |
| DataString : `String`                  | <p>Published data (message) in UTF8 string format.<br>Example: <code>Foo Bar</code></p>             |
| DataByteArray : `Byte[]`               | <p>Published data (message) in byte array format.<br>Example: <code>46 6f 6f 20 42 61 72</code></p> |
| Headers : `Dictionary<String, String>` | <p>Headers of the published message.<br>Example: <code>foo, bar</code></p>                          |
| {% endtab %}                           |                                                                                                     |

{% tab title="Changelog" %}

## Changelog

### \[1.9.0] - 2026-03-17

#### Fixed

* Added missing `Text` attribute to the `VirtualHost` property in Connection parameters to make it automatically use the Text mode instead of Expression mode.

### \[1.8.0] - 2026-02-23

#### Added

* Added CertificateWithCredentials authentication method that requires both a valid client certificate and username/password credentials to connect.
* Added VirtualHost field to Connection parameters to allow specifying a RabbitMQ virtual host. Defaults to "/".

### \[1.7.0] - 2026-02-06

#### Added

* New property: Result.Success.
* New feature: Certificate‑based authentication via `AuthenticationMethod.Certificate`, with new enums (`CertificateSource`, `SslProtocol`, `CertificateStoreLocation`) and connection properties (`ClientCertificatePath`, `ClientCertificatePassword`, `CertificateBase64`, `CertificateBytes`, `StoreThumbprint`, `CertificateStoreLocation`, `SslProtocol`, `CertificateSource`).

#### Changed

* Update RabbitMQ.Client from 7.0.0 to 7.2.0
* Update System.Runtime.Caching from 9.0.2 to 10.0.2

### \[1.6.0] - 2025-11-30

#### Fixed

* Fix the parallel connections issue.
* Fix the issue with binding unnamed queue.

### \[1.5.0] - 2025-02-14

#### Changed

* Update RabbitMQ.Client from 6.8.1 to 7.0.0
* Update System.Runtime.Caching from 8.0.0 to 9.0.2

### \[1.4.0] - 2024-09-12

#### Fixed

* Fixed issue with MemoryCache error `Index was outside the bounds of the array` by adding try - catch block and changing how cache key is formatted.

### \[1.3.0] - 2024-09-06

#### Fixed

* Fixed issue with simultaneous calls by storing connections to Memory.Cache.

### \[1.2.0] - 2023-03-14

#### Fixed

* Fixed issue with connections left open after task's execution by implementing IDisposable in Connectionhelper class.

#### Added

* Added support for quorum queues.
* \[Breaking] Added parameter for connection options to enable creating quorum queues.

### \[1.1.0] - 2023-02-23

#### Fixed

* Fixed NullReferenceException when no headers are defined for the input object.

### \[1.0.1] - 2022-10-12

#### Changed

* Unnecessary input check removed.

### \[1.0.0] - 2022-08-18

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
