Spring JMS

Initialize project with ActiveQM Client


Enable JMS configuration

public class IntegrationConfiguration {


Add integration layer controller

public class EmployeeJms {

    private EmployeeService service;

    @JmsListener(destination = "employee-info-request")
    public String getDepartment(String employeeId) {
        return service.getDepartment(employeeId);

Simulation for business

public class EmployeeService {

    private static final Logger LOGGER = LoggerFactory

    public String getDepartment(String employeeId) {
        LOGGER.info("Begin get department info of employee [{}]", employeeId);
        simulateQuery(employeeId, 3);
        LOGGER.info("End get department info of employee [{}]", employeeId);
        return "Technology";

    private void simulateQuery(String employeeId, int processTime) {
        try {
        catch (InterruptedException e) {


Configure to point to Message Broker

        name: spring-jms
    profiles.active: default
        in-memory: false
        broker-url: tcp://activemq-dev:61616
        user: admin
        password: admin
            auto-startup: true
            concurrency: 3
            max-concurrency: 3

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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