With just a few lines of code that leverage Twilio’s helper library for Node.js you can send SMS and MMS messages from your Node.js application. When your application makes an HTTP POST request to Twilio’s Message resource, the recipient receives your message almost instantly.

Imagine that you’ve built an appointment reminder solution with Twilio. Every evening at 8:00 pm you run a Node.js application that reads appointment data from a .csv file and sends text message reminders to customers who have appointments the next day. It works great, customers are happy.

You want to enhance your application so that it sends a second reminder, let’s say, 15 minutes before the appointment. You could still run the application the night before but, somehow, the delivery of each message needs to be delayed until it’s the right time to be received by the customer.

This can be done in multiple ways, and in this post you’ll see the message broker way. Message brokers are software modules or services which allow distributed software applications to exchange information. The word “message” from “message broker” does not specifically refer to SMS text messages, but rather to chunks of information transferred between applications. Where necessary, this post will refer to these messages as application messages in order to distinguish them from SMS messages. If you’re not familiar with message brokers, pause for just a minute and read the Message broker Wikipedia page.

What are you going to learn

In this post you will learn basic things about message brokers. You’re going to see Apache ActiveMQ™, a popular open source message broker in action, learn how to write client applications for the broker, and learn how these clients interact with it. You’ll also see how to use Twilio Programmable SMS and the Twilio helper library for Node.js to send SMS messages.

What are you going to build

This tutorial provides complete instructions and code for building a Node.js application that reads appointment and customer data from a .csv file, then sends appointment reminders a few minutes before each appointment by scheduling the delivery of SMS text messages.


You’ll need the following tools and resources to build the project described in this tutorial. For best results, fulfill these prerequisites in the order listed:

  • Java – version 8+, required by ActiveMQ
  • Node.js – The Node.js installer also installs npm, which you’ll need to install packages.
  • Visual Studio Code – or your preferred IDE or text editor
  • Twilio trial account – Sign up with this link to get a $10 credit when you upgrade your account.
  • Twilio phone number – Select a number with SMS capability.

This tutorial uses the Java SE runtime environment, but doesn’t require any Java programming knowledge. A working knowledge of JavaScript and the Node.js runtime environment will be helpful. No prior experience with the Twilio Programmable SMS API or the helper library for Node.js is necessary.

There is a companion repository for this post available on GitHub. It contains the complete source code for the project you’ll build in this tutorial.

Installing ActiveMQ

Verify that you have the required Java Runtime Environment. Open a terminal or a command window and run:

java -version

#node #python #git #github #activemq #activemq

Sending Appointment Reminder Messages with ActiveMQ, Node.js
3.95 GEEK