Chapter 6. Interoperability


This chapter discusses how to use AMQ C++ in combination with other AMQ components. For an overview of the compatibility of AMQ components, see the product introduction.

6.1. Interoperating with Other AMQP Clients

AMQP messages are composed using the AMQP type system. This common format is one of the reasons AMQP clients in different languages are able to interoperate with each other.

When sending messages, AMQ C++ automatically converts language-native types to AMQP-encoded data. When receiving messages, the reverse conversion takes place.

Note

More information about AMQP types is available at the interactive type reference maintained by the Apache Qpid project.

Table 6.1. AMQ C++ and AMQP Types
AMQ C++ TypeAMQP TypeDescription

nullptr

null

An empty value

bool

boolean

A true or false value

wchar_t

char

A single Unicode character

std::string

string

A sequence of Unicode characters

proton::binary

binary

A sequence of bytes

int8_t

byte

A signed 8-bit integer

int16_t

short

A signed 16-bit integer

int32_t

int

A signed 32-bit integer

int64_t

long

A signed 64-bit integer

uint8_t

ubyte

An unsigned 8-bit integer

uint16_t

ushort

An unsigned 16-bit integer

uint32_t

uint

An unsigned 32-bit integer

uint64_t

ulong

An unsigned 64-bit integer

float

float

A 32-bit floating point number

double

double

A 64-bit floating point number

std::vector

list

A sequence of values of variable type

std::map

map

A mapping from distinct keys to values

proton::uuid

uuid

A universally unique identifier

proton::symbol

symbol

A 7-bit ASCII string from a constrained domain

proton::timestamp

timestamp

An absolute point in time

Table 6.2. AMQ C++ and Other AMQ Client Types
AMQ C++AMQ PythonAMQ JavaScriptAMQ .NET

nullptr

None

null

null

bool

bool

boolean

System.Boolean

wchar_t

proton.char

-

System.Char

std::string

unicode

string

System.String

proton::binary

bytes

wrap_binary(string)

System.Byte[]

int8_t

proton.byte

wrap_byte(number)

System.SByte

int16_t

proton.short

wrap_short(number)

System.Int16

int32_t

proton.int32

wrap_int(number)

System.Int32

int64_t

long

wrap_long(number)

System.Int64

uint8_t

proton.ubyte

wrap_ubyte(number)

System.Byte

uint16_t

proton.ushort

wrap_ushort(number)

System.UInt16

uint32_t

proton.uint

wrap_uint(number)

System.UInt32

uint64_t

proton.ulong

wrap_ulong(number)

System.UInt64

float

proton.float32

wrap_float(number)

System.Single

double

float

wrap_double(number)

System.Double

std::vector

list

wrap_list(Array)

Amqp.List

std::map

dict

wrap_map(object)

Amqp.Map

proton::uuid

uuid.UUID

-

System.Guid

proton::symbol

proton.symbol

wrap_symbol(string)

Amqp.Symbol

proton::timestamp

proton.timestamp

wrap_timestamp(number)

System.DateTime

6.2. Interoperating with AMQ JMS

AMQP defines a standard mapping to the JMS messaging model. This section discusses the various aspects of that mapping. For more information, see the AMQ JMS Interoperability chapter.

JMS Message Types

AMQ C++ provides a single message type whose body type can vary. By contrast, the JMS API uses different message types to represent different kinds of data. The table below indicates how particular body types map to JMS message types.

For more explicit control of the resulting JMS message type, you can set the x-opt-jms-msg-type message annotation. See the AMQ JMS Interoperability chapter for more information.

Table 6.3. AMQ C++ and JMS Message Types
AMQ C++ Body TypeJMS Message Type

std::string

TextMessage

nullptr

TextMessage

proton::binary

BytesMessage

Any other type

ObjectMessage

6.3. Connecting to AMQ Broker

AMQ Broker is designed to interoperate with AMQP 1.0 clients. Check the following to ensure the broker is configured for AMQP messaging.

  • Port 5672 in the network firewall is open.
  • The AMQ Broker AMQP acceptor is enabled. See Configuring Network Access.
  • The necessary addresses are configured on the broker. See Addresses, Queues, and Topics.
  • The broker is configured to permit access from your client, and the client is configured to send the required credentials. See Broker Security.

6.4. Connecting to AMQ Interconnect

AMQ Interconnect works with any AMQP 1.0 client. Check the following to ensure the components are configured correctly.

  • Port 5672 in the network firewall is open.
  • The router is configured to permit access from your client, and the client is configured to send the required credentials. See Interconnect Security.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.