Skip to main content
Altcraft Docs LogoAltcraft Docs Logo
User guide iconUser guide
Developer guide iconDeveloper guide
Admin guide iconAdmin guide
English
  • Русский
  • English
Login
    Getting StartedAdministrator documentationFunctional characteristics
      Technology descriptionarrow
    • Architecture OverviewComponent Description
        Deployment schemesarrow
      • Basic schemeFail-safe schemeTypical Placement in Infrastructure
    System requirements
      Admin Panelarrow
      • Account areaarrow
        • Accountsarrow
        • Account UsersAccount Virtual SendersAccount Database Indexes
        TariffsExternal data configurationLDAPTasksSchedule JobsGlobal Stop ListsWebversion Store Policies
        Settingsarrow
      • Databases
          Accessarrow
        • AdminsAPI tokens
        Notifiers
          MTAarrow
        • Default rulesRetry rulesLock rulesBounce patternsStrategiesKeysISPsPools
      Nodes
        Sendersarrow
      • EmailSMSEvent generatorIntegration with Altcraft Cloud SMTPIntegration with Sendsay
        Reportsarrow
      • Audit JournalData Usage
        Toolsarrow
      • ARF decoderURL decoderSMID decoderLicense
      Platform installationarrow
    • Automatic installationManual installationRunning the platform in a Docker container
      Platform configurationarrow
    • Configuration fileDomain settingsLDAP access configurationSending Email via SMTP relayPixel and push domain configurationCluster and Replication SetupSystem notifications configurationProcesses UNIX sockets configurationHTTPS ConfigurationMigrating from MongoDB Community Edition to Percona Server for MongoDBAdding sender IP addressesDeduplication request settingsPostgreSQL database for Market dataProxy server settingsKeycloak Integration with AltcraftGetting HTTP service statusesConfiguring MongoDB log rotation
        Configuration of system constants and directoriesarrow
      • Filtering bot actionsDirectory of gender markers
      Custom Channelsarrow
    • Creating a Channel
        Pipelinesarrow
      • MessageScheduleListenerModerateStop
          Pipesarrow
        • HTTP RequestPackUnpackEventerSchedulerSelectorSQLStore SetStore GetLogResultErrorRMQ Publisher
      External Objects (Entities)Templating LanguageSending FilesPresets (Field Sets)DebuggingTechnical Limitations
      Platform maintenancearrow
    • Personnel requirementsPlatform maintenance processesPlatform updatingBackup and recoveryTransferring the platform to a new serverCreating, deleting, and populating tables for statistics in ClickHouseUsing the aktool utilityUsers and directories engaged by the platformPlatform service monitoringProcess and mailing monitoring via Prometheus
      Extraarrow
    • System page customizationSend Message IDClickHouse History Migration GuideInstructions for migrating history to ClickHouseUtility for importing push subscriptions to Firebase projectUtility for importing push subscriptions to Firebase projectENS: настройка интеграции
    Processing HTTP/HTTPS traffic
      Administrator APIarrow
      • Accounts admin apiarrow
        • Restricted accessarrow
        • Account Activation and DeactivationAccount Freeze and Unfreeze
        Get accounts listAdd a new accountDelete the account
        Account usersarrow
      • Update an Existing AccountAdd a new userDelete a userGet a list of usersSending a Welcome Email
        Nodesarrow
      • Synchronize node MTA configurationGet nodes listGet node MTA statusActivate node MTADeactivate node MTA
        Senders admin apiarrow
      • Create or update AKMTA senderGet AKMTA sender informationAssign account to senderGet senders listDelete senderRestore sender
          Sender queuearrow
        • Get sender queue informationHold sender queueRelease sender queueClear sender queue
        Virtual sendersarrow
      • Get virtual senders listGet virtual sender informationCreate virtual senderUpdate virtual senderClone virtual senderDelete virtual sender
    Documentation Archive
  • Custom Channels
  • Pipelines
  • Pipes
  • RMQ Publisher

RMQ Publisher

RMQ Publisher — a pipe for publishing messages to RabbitMQ. Used to send data to external services via a RabbitMQ broker. Typical scenario: sending push notifications through an external delivery service.

Input data​

The pipe expects $in.body — the message body to publish:

  • If $in.body is a byte array ([]byte), it is used directly
  • If $in.body is a string, it is decoded from base64 to []byte

Typically, an Pack pipe is placed before RMQ Publisher, which forms JSON or XML and writes the result to $in.body.

Parameters​

FieldTypeRequiredDefaultDescription
connector_shortnamestringYes—String name of the RMQ connector created in External Data Configuration
content_typestringNojsonContent type: json or xml
delivery_modenumberNo—Delivery mode: 1 (transient — message is not persisted to disk) or 2 (persistent — message is saved to the broker disk)
headersobjectNo—Additional message headers (map[string]string). Supports templating
targetobjectYes—Publication target object (see below)

Target object (target)​

The pipe supports two target options:

Exchange:

FieldTypeRequiredDescription
typestringYesValue: exchange
exchange_namestringYesExchange name in RabbitMQ
exchange_typestringNo (default: direct)Exchange type: direct, topic, fanout, headers
routing_keystringNoRouting key

Queue:

FieldTypeRequiredDescription
typestringYesValue: queue
queue_namestringYesQueue name in RabbitMQ

Possible errors​

  • $in.body not found (missing Pack pipe before RMQ Publisher)
  • $in.body is not a byte array or string (base64)
  • Invalid content_type value (only json or xml)
  • Connector not found by connector_shortname
  • Connector is not an RMQ connector
  • RabbitMQ publication error (network error, broker unavailable, etc.)

Examples​

Publish to exchange​

A Pack pipe should precede this pipe in the chain to form the message body.

{
"id": 2,
"type": "rmq_publish",
"params": {
"connector_shortname": "ens_push",
"content_type": "json",
"delivery_mode": 2,
"target": {
"type": "exchange",
"exchange_name": "fintechiq.push-manager.send",
"exchange_type": "topic",
"routing_key": "fintechiq.push-manager.push.by-text.send"
}
},
"outs": {
"success": 4,
"error": 100
}
}

Publish to queue​

{
"id": 2,
"type": "rmq_publish",
"params": {
"connector_shortname": "my_rmq",
"content_type": "json",
"delivery_mode": 2,
"headers": {
"message_id": "$origin.send_message_id"
},
"target": {
"type": "queue",
"queue_name": "notifications.inbox"
}
},
"outs": {
"success": 3,
"error": 4
}
}

Migrating from HTTP Request to RMQ Publisher​

If the external service accepts messages via RabbitMQ instead of an HTTP API, replace the HTTP Request pipe with RMQ Publisher. The rest of the chain (Pack, Selector, Log) remains unchanged.

What changes​

Pipe http_request (id:3) is replaced with rmq_publish using the same id:

{
"id": 3,
"type": "rmq_publish",
"params": {
"connector_shortname": "cas_rmq",
"content_type": "json",
"delivery_mode": 2,
"target": {
"type": "exchange",
"exchange_name": "cas.notifications",
"exchange_type": "topic",
"routing_key": "cas.message.send"
}
},
"outs": {
"success": 10,
"error": 12
}
}

Parameters url, method, timeout, success_codes are removed. Instead — connector_shortname and target. The Pack pipe before RMQ Publisher works the same way — it forms $in.body, which is published to RabbitMQ.

Creating an RMQ connector​

Before using the pipe, create a connector in External Data Configuration:

FieldDescription
NameArbitrary name
Short NameUnique identifier — used in the pipe's connector_shortname
HostRabbitMQ broker address
PortPort (default 5672)
UsernameLogin
PasswordPassword
VhostVirtual host
SSLSSL and PEM certificates (if needed)

Routing messages with Selector​

To direct messages to different queues or exchanges based on event data, use a Selector before multiple RMQ Publisher pipes.

Scheme:

Pack → Selector → RMQ Publisher (priority)
↘ RMQ Publisher (normal)

Both pipes can use the same connector — the connection is cached and shared between pipes.

Example: priority and normal notifications​

The $template.priority field determines the routing key:

[
{
"id": 1,
"type": "pack",
"params": {
"type": "JSON",
"template": {
"messageId": "$in.send_message_id",
"priority": "$template.priority",
"body": "$template.text",
"recipient": "$subscription.client_id"
}
},
"outs": {
"success": 2,
"error": 99
}
},
{
"id": 2,
"type": "selector",
"params": {
"outs": [
{
"query": "('$template.priority' = 'high')",
"out": 10
},
{
"query": "('$template.priority' = 'low')",
"out": 20
}
]
},
"outs": {
"success": 20,
"error": 99
}
},
{
"id": 10,
"type": "rmq_publish",
"params": {
"connector_shortname": "cas_rmq",
"content_type": "json",
"delivery_mode": 2,
"target": {
"type": "exchange",
"exchange_type": "topic",
"exchange_name": "cas.notifications",
"routing_key": "cas.priority.send"
}
},
"outs": {
"success": 30,
"error": 99
}
},
{
"id": 20,
"type": "rmq_publish",
"params": {
"connector_shortname": "cas_rmq",
"content_type": "json",
"delivery_mode": 2,
"target": {
"type": "exchange",
"exchange_type": "topic",
"exchange_name": "cas.notifications",
"routing_key": "cas.normal.send"
}
},
"outs": {
"success": 30,
"error": 99
}
},
{
"id": 30,
"type": "log",
"params": {
"message": "published successfully"
}
},
{
"id": 99,
"type": "log",
"params": {
"message": "error: $error.code $error.message",
"level": "error"
}
}
]

Here:

  1. Pack (id:1) forms the JSON message body
  2. Selector (id:2) checks $template.priority:
    • high → pipe 10 (routing key cas.priority.send)
    • low → pipe 20 (routing key cas.normal.send)
    • no match → outs.success → pipe 20 (fallback)
  3. Each RMQ Publisher publishes to its routing key
  4. Both converge on pipe 30 (success) or 99 (error)

Selector conditions are checked in order — the first match wins. If no condition matches, the event goes to outs.success, which is convenient for a fallback route. All event data is available in query: $template.*, $subscription.*, $campaign.*, $in.*, $origin.*.

Different brokers for different routes​

If queues are on different RabbitMQ brokers, create two connectors and use different connector_shortname values in each RMQ Publisher pipe.

Last updated on Jul 29, 2026
Previous
Error
Next
External Objects (Entities)
  • Input data
  • Parameters
    • Target object (target)
  • Possible errors
  • Examples
    • Publish to exchange
    • Publish to queue
  • Migrating from HTTP Request to RMQ Publisher
    • What changes
    • Creating an RMQ connector
  • Routing messages with Selector
    • Example: priority and normal notifications
    • Different brokers for different routes
© 2015 - 2026 Altcraft, LLC. All rights reserved.