Message Queuing on Heroku

Message Queuing on Heroku

If you are looking for a way to efficiently exchange information between different services, then message queues are exactly what you need. By using message queues, you can be sure that your data will be delivered to the recipient quickly and reliably.

IronMQ is the Heroku Add-on that implements message queues simple, fast and reliable. It is characterized by its ease of use and, at the same time, high availability and reliability. Try the IronMQ demo for free now and enjoy all its benefits.

Achieve Cloud Elasticity with Iron

Speak to us to find how you can achieve cloud elasticity with a serverless messaging queue and background task solution with free handheld support.

What is Message Queuing?

Message Queuing is a way of asynchronous communication between programs. Messages are data that is transmitted from sender to receiver.

A queue is a chain of messages that are sent between services. In this case, the sender is called the producer, and the recipient is called the consumer.

A producer and a consumer work separately and independently of each other. The producer creates messages and sends them to the queue. The consumer takes messages from the queue and processes them. The consumer is a separate component. It knows nothing about the producer and does not depend on it.

A simple example of message queuing is the email service. The producer sends a message that is stored in a special system until the consumer processes it. In this case, the producer can perform other actions without waiting for its message to be processed.

There are different implementations of message queuing:

  • Internal - message queues function inside the operating system or application.
  • External - messages can be transferred between different computer systems using multiple applications or multiple operating systems.

Message queues can be stored in the computer's RAM, on a hard disk, or on a special server, depending on how message queues are implemented.

Main advantages of using message queues

  1. Independent producer and consumer that allows them to be implemented in different programming languages, placed on different computers, supported, and scaled separately from each other.
  2. Failure in one part of the system does not affect the other part. If the producer is not working, then the consumer can continue to receive messages from the queue and process them. If the consumer is not working, then the producer can continue to write messages to the queue.
  3. Asynchronous implementation, which makes the process of sending messages very fast.
  4. The ability to choose the order in which the program will process messages.
  5. The ability to balance the load on the system by creating additional message handlers if the number of messages exceeds a threshold.
  6. The ability to limit the size of a message and the number of messages that can be in the queue.

Building an application architecture that implements message queues is a complex task. Fortunately, there are special frameworks and services that solve this problem for us. One of these services is IronMQ. Below we will consider how to work with it in more detail.

What is Heroku?

Heroku is a cloud platform that makes it easy to deploy, extend, manage and run modern applications. It supports a lot of modern programming languages ​​such as Ruby, Java, Node.js, Python, Go, PHP, Scala, and Clojure.

Heroku includes several services: Heroku Platform, Heroku Data Service, Heroku Enterprise, Heroku Teams.

Heroku Platform comes with a managed runtime and offers features for easy application deployment. It also allows users to manage add-ons, resources and identify and resolve application problems. The Heroku Platform offers authentication, SSL, and compliance with different security protocols.


Heroku Data Service offers services for Postgres, Redis, and Apache Kafka databases. It provides high performance, easy scalability, and data backup.


Heroku Enterprise integrates vendor and developer functionality and provides management functionality for large businesses. It provides more security for applications and offers features for building applications with high compliance requirements.


Heroku Teams enables collaboration between users and can be used to manage, configure resources, change permissions, and more.

Key benefits of using Heroku

  1. Free start. You can get started with the free Heroku plan to create a small cloud application and test the basic features of Heroku.
  2. Provides access to many useful features that greatly speed up the application development process and allow developers to focus on critical development activities without having to complete repetitive tasks.
  3. Allows you to easily create new software releases and deploy them with one click of the mouse.
  4. Provides an intuitive toolbar that makes it easy to manage applications.
  5. Horizontal scaling. Automatically detects bursts of traffic while being able to easily create multiple new instances of an application.
  6. Ensures the security of application development and prevents any potential security issues.
  7. Contains a lot of cloud services for creating and managing applications.


There are also a huge number of Heroku Add-ons. Heroku Add-ons are powerful features with different functions that you can easily add to your applications. Below we will consider Heroku Add-ons in more detail.

Heroku Add-ons

Heroku Add-ons are tools that provide additional functionality to your applications. With Heroku Add-ons, you can store data, manage databases, monitor and analyze your applications, send emails and SMS to users, cache regularly used data, find and fix errors, and much more.

You can install any number of Add-ons in your application, and in some cases, any number of instances of a single Add-on. It is also possible to share some Add-ons between several applications that have one owner. Some Add-ons have their own dashboards that you can use to manage.

Using IronMQ for working with Message Queue

One of the Heroku Add-ons is IronMQ. This is a service that allows you to work with message queues. IronMQ has three components:

  • Producers are components that post messages to a queue.
  • Consumers are components that receive messages from a queue.
  • Queues are components that store sent messages.

Let's take a look at how IronMQ works with message queues. First, the producer creates a queue and sends a message to it. IronMQ sends messages from the queue to consumers. IronMQ retains the sent message until it is confirmed by the consumer or timed out. Consumers can receive a message in two ways: by retrieving it from the IronMQ queue, or by sending a message to them by IronMQ. If the message is not delivered within the specified time, it will be repeated.

IronMQ supports most modern programming languages. You can see examples of how to work with message queues in different languages. Serverless Tools

Speak to us to learn how IronWorker and IronMQ are essential products for your application to become cloud elastic.

Install IronMQ on Heroku

There are two ways to install IronMQ: via the Heroku dashboard or using the command line.

Installing IronMQ via Heroku dashboard

  1. Open the IronMQ Add-on page.
  2. In the upper right corner, click Install IronMQ Message Queue.

Installing IronMQ using the command line

  1. Install the IronMQ Add-on for Heroku.
$ heroku addons:create iron_mq:developer
  1. Install the IronMQ client library (for example, Ruby).
$ gem install iron_mq
  1. Configuration: retrieve Token and Project ID.
$ heroku config | grep IRON
  1. Use the installed client lib to interact with your queues (create a queue, post/get/delete a message, etc.). 

Advantages of using IronMQ

The main advantages of using IronMQ for working with message queues are:

  1. Easy to use. IronMQ has a REST API with which developers can easily create and monitor queues.
  2. It supports most modern programming languages ​​, including Ruby, Python, PHP, Java, Go, Node.js.
  3. IronMQ provides tools for real-time monitoring of message queues. This allows you to quickly and easily find and correct errors.
  4. It has reliable data storage and the best cloud infrastructure to ensure the high availability of data.
  5. One-time FIFO delivery.
  6. A dedicated queue for undelivered messages.
  7. IronMQ supports messages up to 256 KB in any format. It allows transferring larger messages using IronCache, which is 1 MB in size.
  8. IronMQ secures transmitted data by using HTTPS encryption for its API and OAuth2 authentication.
  9. The ability to manage the load on the system without the need to manage the infrastructure. IronMQ does it for you.
  10. High scalability.
  11. Ability to create queues of different types (i.e., pull, push, long polling).
Message Queuing on Heroku


Do you want to take full advantage of Message Queuing for your microservice architecture? How about focusing on the logic of your application and not thinking about how a complex tool like Message Queuing works? Use IronMQ and take full advantage of it.

IronMQ offers a simple and intuitive control panel, built-in metrics, and reports that allow you to monitor your application in real-time. It has a user-friendly API for easy and fast creation and management of message queues. IronMQ provides fast message processing, security, high scalability, and much more.

Install IronMQ Add-on for Heroku and take full advantage of IronMQ when working with Heroku.


Try a free trial of IronMQ and enjoy all the benefits of its premium service.

Unlock the Cloud with

Find out how IronWorker and IronMQ can help your application obtain the cloud with fanatical customer support, reliable performance, and competitive pricing.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.