Open amarzavery opened 6 years ago
It is a way of overriding the container-id sent to the peer in the open frame. It has no impact on the container object the connection is associated with, it just prevents the connection using the id of that associated container instead using the value provided.
The container-id is how the peer will identify the 'container' the connection is being established from. The container in AMQP terminology is roughly analogous to a process. Using a different container id on connections from the same process would cause the peer to treat them as coming from distinct processes.
I see. Thanks for the prompt response. I think connection object should have a readonly property named container_id.
Connection.prototype.container_id = this.options.container_id || this.container.id;
This ensures that users will get the right container id when they are using it in their app or are using it for logging purposes. What do you think about it?
this.options.container_id will always be the right value, whether it came from the associated container or the application specified it explicitly
I thought that by providing the container_id, rhea will create a new container object with the provided id and then create a connection on that container. However,
connection.options.container_id
is"container-123"
and connection.container refers to the default container instance.This seems a little weird. What is the use case for providing a container_id in the connectionOptions? If provided then what is the effect?