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

Fixed initialization error in DarwinClientRouteBuilder.clientId #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Vincibean
Copy link

@Vincibean Vincibean commented Apr 17, 2019

Problem

In DarwinClientRouteBuilder, the clientId depends on the username, which in turn is a Spring @Value taken from application.properties and populated with the value corresponding to the property darwinv16.username.

Because of how Spring works, the injection of this value can happen after the class has been built. clientId however is built in the class' constructor. This leads to the clientId being initialized with a username that, at the time of class initialization, is still null. This means that the clientId in turn will be something along the lines of null-yourHostName, and since "if you are using a Durable Subscriber, your Client ID must begin with your username", the whole setup of the JMS message listener invoker will fail with:

Setup of JMS message listener invoker failed for destination 'darwin.pushport-v16' - trying to recover. Cause: Durable subscription clientId must start with your username

Solution

Make this dependency between the username and the clientId explicit in the constructor, by promoting username as constructor parameter and adding the relative @Value annotation before it.

Note

This is an alternative approach to what was proposed in #2
In case that PR shall be merged, this one should be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant