This repository contains examples how to setup ActiveMQ Classic and how to send/receive messages using java. Please note, that code in this repo does not work with ActiveMQ Artemis. See Artemis repo for according examples.
On your computer the following software needs to be installed:
- git (Windows or Winget, Linux - use package manager)
- openJDK (aka Java Development Kit)
- Maven
- an IDE to write code - Visual Studio Code is recommended.
Optional
- Microsoft Terminal nicer Terminal for Windows, Standard on Windows 11
- Docker - running containers
- JQ - handy tool to work with JSON
- Java Mission Control
- HawtIO
Use git to download code from this repository to your computer. Open a command prompt/shell and use the following command to clone repository into current directory:
git clone https://github.com/starwit-trainings/activemq-classic-tutorial.gitYou need to download and unzip ActiveMQ for your operating system. Find fitting package here: https://activemq.apache.org/components/classic/download/
All examples in this repo expect, that ActiveMQ is unzipped next to repo main repository. Resulting folder structure should look like so:
.
..
activemq-classic-tutorial
apache-activemq-6.1.6In order to take a deeper dive into ActiveMQ's capabilities, some basic concepts needs to be addressed. So sectio Messaging concepts provides an overview of these ideas.
In this section all examples in this repository are introduced. You can work with these examples in any order you like.
In every programming language it is tradition to write a program that outputs hello world. In messaging things are a bit more complicated. So the hello world section explains how to send your first message via a message broker.
ActiveMQ is versatile communication broker and thus be run in various configurations. Section ActiveMQ Setups provides examples for the most important setups.
A message broker is of little use, if no application is using it. One way to use ActiveMQ is by using the Java programming language. See Java section for how to connect to ActiveMQ and various examples.
While Java is a powerful programming language, building applications needs more. So this section will show you, how to use the Spring Boot to connect to ActiveMQ and how to integrate messaging in your applications. All examples can be found in Spring Boot section.
Camel is a powerful framework to build message oriented applications. See section Camel for an introduction and examples.