Validated User-ID

In some scenarios it is useful for consumers to be able to know the identity of the user who published a message. We have therefore made sure that the user-id message property is validated. If this property is set by a publisher, its value must be equal to the name of the user used to open the connection. If the user-id property is not set, the publisher's identity remains private.

For example (in Java):

AMQP.BasicProperties properties = new AMQP.BasicProperties();
properties.setUserId("guest");
channel.basicPublish("amq.fanout", "", properties, "test".getBytes());

This message will only be published successfully if the user is "guest".

If security is a serious concern, you should probably combine the use of this feature with SSL based connections.