Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Session re-creates durable JMS topic exchange between restarts #456

Open
acogoluegnes opened this issue Jun 20, 2024 · 0 comments
Open

Session re-creates durable JMS topic exchange between restarts #456

acogoluegnes opened this issue Jun 20, 2024 · 0 comments
Assignees

Comments

@acogoluegnes
Copy link
Contributor

The library creates a session-scoped durable JMS topic exchange for durable topic subscribers with a selector. It uses a UUID in the name. The exchange is not deleted between restarts (to keep messages for closed durable subscribers), so a new session would create yet another exchange. The documentation explains this design. A new binding with the selector arguments is created between the exchange and the subscriber queue.

This avoids creating an exchange for each subscriber, but it makes it impossible to re-use the existing exchange, making the exchanges leak until the subscribers unsubscribe.

It'd be more appropriate to create a dedicated exchange for each durable subscriber with a selector. The name would be based on the topic and subscription names (using a hashing mechanism, to control the length), this way the exchange could be re-used between restarts.

The name could use a MD5 of the topic and subscription names, with a base 64 encoding (+ replaced by -, / by _, = removed). This is the algorithm used for server-named queues.

Original discussion: #454

acogoluegnes added a commit that referenced this issue Jun 20, 2024
github-actions bot pushed a commit that referenced this issue Jun 20, 2024
@lukebakken lukebakken self-assigned this Jun 20, 2024
acogoluegnes added a commit that referenced this issue Jun 20, 2024
References #456

(cherry picked from commit fbed08b)
jjank pushed a commit to jjank/rabbitmq-jms-client that referenced this issue Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants