Message Queue (MQ) Listener

Message Queue (MQ) Listener

Overview

With the Message Queue Listener Input Block, you can configure connections to the following message queue types:

To select the message queue type you want to use for a Message Queue Listener connection, click on its name in the Message Queue Type drop-down list at the top of the block’s settings.

If you would like to use a Message Queue Listener connection in a SaaS instance and your MQ service is not public, you should create a firewall pinhole for the connection. Contact your Hyperscience representative for more information.

Sample use cases

Message format

A JSON object must be passed to the message queue in order for Hyperscience to read the appropriate input image files. It should have the same format as the request payload for the Submission Creation API endpoint, with one key difference: in the MQ message payload, the files element is an array of file URLs and does not contain individual file_url elements.

An example MQ message payload is shown below.

{
  "flow_uuid": "a89d6440-a2c2-423b-8c95",
  "machine_only": "true",
  "files": [
    "s3://s3-bucket/input/demo-file.pdf",
    "https://example.com/files/demo-file.pdf",
    "ocs://2021"
  ]
}

For more information about the Submission Creation payload, see the Submission Creation section of our API documentation.

Block settings table

In addition to the settings outlined below, you can also configure the settings described in Universal Integration Block Settings.

ActiveMQ

Name Required? Description
Username Yes The username of a user that has access to the message queue.
Password Yes The password of a user that has access to the message queue.
Queue Name Yes The name of the message queue in ActiveMQ.
Host Name Yes The hostname of the system where the message queue is being run.

Amazon SQS

Name Required? Description
AWS Region Yes The AWS region of the source data.
Access Key ID No The access key ID allows access to the message queue.
Secret Access Key No The secret access key allows access to the message queue.
Queue URL Yes The queue URL for sending messages.
Use AWS EC2 Instance IAM Role Credentials Yes If selected, credentials are obtained from the EC2 instance directly, and Access Key ID and Secret Access Key are not present.

Additional configurations

The following permissions should be granted via the AWS interface:

Message size

Note that Amazon imposes certain limitations on the size of messages sent to Amazon SQS message queues. At the time of writing this article, the maximum message size allowed is 256KB.

IBM MQ

Name Required? Description
No Auth Credentials Required Yes Indicates whether the connection requires a username and password.
Username Yes, if available The username of a user that has access to the queue manager.
Password Yes, if available The password of a user that has access to the queue manager.
Queue Name Yes The name of the message queue in IBM MQ.
Host Name Yes The hostname of the system where the message queue is being run.
Port Number Yes The port number the connection should use to access the queue manager.
Queue Manager Yes The name of the message queue's queue manager in IBM MQ.
Channel Yes The queue manager's channel in IBM MQ.
SSL Cipher Suite Yes, if you want to use an SSL connection The CipherSuite connection should use to communicate with the queue manager.

RabbitMQ

Name Required? Description
Username Yes The username of a user that has access to the message queue.
Password Yes The password of a user that has access to the message queue.
Queue Name Yes The name of the message queue in RabbitMQ.
Host Name Yes The host name of the system where the message queue is being run.
Port Number Yes The port number the connection should use to access the message queue.
Virtual Host No The name of the virtual host where the message queue is being run.
Connection Type Yes Specify whether the connection is a TCP or SSL connection.

Setting up Message Queue Listener

All Message Queue Listener connections can be set up in Hyperscience, but Amazon SQS connections require additional configuration steps in AWS.

Setting up a Message Queue Listener in Hyperscience

To set up any of the Message Queue Listener Input Blocks, follow these steps.

  1. Log in to your Hyperscience instance.
  2. Go to Flows and choose any flow.
  3. Scroll to the start of the flow in the Flow Studio and click Inputs.
  4. Click Add and select Message Queue Listener from the list.
  5. Click the Add Connection button.
  6. From the Message Queue Type drop-down menu, select your Message Queue Type and enter the Block settings described above.

If you are setting up an ActiveMQ, IBM MQ, or RabbitMQ connection, you do not need to complete any additional steps.

If you are setting up an Amazon SQS connection, you also need to complete the steps outlined in Setting up an Amazon SQS connection in AWS.

Setting up a DLQ

To set up a DLQ, see the instructions for the MQ listener you’re currently using:

If you’re setting up a DLQ, make sure to set the DISCARD_MALFORMED_RESOURCES “.env” file variable to false.