O'Reilly logo

Hands-On High Performance with Spring 5 by Dinesh Radadiya, Prashant Goswami, Pritesh Shah, Subhash Shah, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a message producer

To run this application, we will use the RabbitTemplate.convertAndSend() method to send the message. This method also converts custom Java objects to AMQP messages and is sent to direct exchange. The following BankAccount class is created as a custom class to populate the message properties:

public class BankAccount {    private int accountId;    private String accountType;    public BankAccount(int accountId, String accountType) {        this.accountId = accountId;        this.accountType = accountType;    }    public int getAccountId() {        return accountId;    }    public String getAccountType() {        return accountType;    }    @Override    public String toString() {        return "BankAccount{" +                "Account Id=" + accountId + ", Account Type='" + accountType + '\'' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required