Red Hat Training

A Red Hat training course is available for Red Hat AMQ

Chapter 6. Interoperability

This chapter discusses how to use AMQ Python 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 Python 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 Python and AMQP Types

AMQ Python TypeAMQP TypeDescription

None

null

An empty value

bool

boolean

A true or false value

proton.char

char

A single Unicode character

unicode

string

A sequence of Unicode characters

bytes

binary

A sequence of bytes

proton.byte

byte

A signed 8-bit integer

proton.short

short

A signed 16-bit integer

proton.int32

int

A signed 32-bit integer

long

long

A signed 64-bit integer

proton.ubyte

ubyte

An unsigned 8-bit integer

proton.ushort

ushort

An unsigned 16-bit integer

proton.uint

uint

An unsigned 32-bit integer

proton.ulong

ulong

An unsigned 64-bit integer

proton.float32

float

A 32-bit floating point number

float

double

A 64-bit floating point number

proton.Array

array

A sequence of values of a single type

list

list

A sequence of values of variable type

dict

map

A mapping from distinct keys to values

uuid.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 Python and Other AMQ Client Types

AMQ PythonAMQ C++AMQ JavaScriptAMQ .NET

None

nullptr

null

null

bool

bool

boolean

System.Boolean

proton.char

wchar_t

-

System.Char

unicode

std::string

string

System.String

bytes

proton::binary

wrap_binary(string)

System.Byte[]

proton.byte

int8_t

wrap_byte(number)

System.SByte

proton.short

int16_t

wrap_short(number)

System.Int16

proton.int32

int32_t

wrap_int(number)

System.Int32

long

int64_t

wrap_long(number)

System.Int64

proton.ubyte

uint8_t

wrap_ubyte(number)

System.Byte

proton.ushort

uint16_t

wrap_ushort(number)

System.UInt16

proton.uint

uint32_t

wrap_uint(number)

System.UInt32

proton.ulong

uint64_t

wrap_ulong(number)

System.UInt64

proton.float32

float

wrap_float(number)

System.Single

float

double

wrap_double(number)

System.Double

proton.Array

-

wrap_array(Array, code)

-

list

std::vector

wrap_list(Array)

Amqp.List

dict

std::map

wrap_map(object)

Amqp.Map

uuid.UUID

proton::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 Python 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 Python and JMS Message Types

AMQ Python Body TypeJMS Message Type

unicode

TextMessage

None

TextMessage

bytes

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.