Yang Lifan
Yang Lifan

Reputation: 465

What's means of each part of JMS message ID?

A JMS message ID looks like this ID:10.77.42.209-4280-1477454185311-1:1:1391:1:1. The whole string is divided by "-" and ":" into several parts.

It is obviously that one part represents the IP address of the producer, some part may represent the message ID. But what's means of others?

So my question is what's means of each parts?

Use ActiveMQ and did not custom the message ID

Upvotes: 3

Views: 3022

Answers (1)

Vasu
Vasu

Reputation: 22442

JMSMessageID is unique string and the generation logic is up to the JMS provider.

The below is JMSMessageID definition taken from specification:

A JMSMessageID is a String value which should function as a unique key for identifying messages in a historical repository. The exact scope of uniqueness is provider defined.

As you are interested in ActiveMQ, it consists of:

HostName + "-" + Port + "-" + System.currentTimeMillis() + "-" + sequenceNumber

You can refer the complete code here for ActiveMQ Id generator logic.

Upvotes: 7

Related Questions