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

CAMEL-14242: Fix binding parameters with arg.- is not possible when using endpointdsl and RabbitMQ #3385

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -185,6 +185,8 @@ protected RabbitMQEndpoint createEndpoint(String uri,
}
}

@SuppressWarnings("unchecked")
Map<String, Object> args = resolveAndRemoveReferenceParameter(params, "args", Map.class, getArgs());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not needed, under by setProperties is doing the job to resolve the args param

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as my next comment

@SuppressWarnings("unchecked")
Map<String, Object> clientProperties = resolveAndRemoveReferenceParameter(params, "clientProperties", Map.class, getClientProperties());
TrustManager trustManager = resolveAndRemoveReferenceParameter(params, "trustManager", TrustManager.class, getTrustManager());
Expand All @@ -202,6 +204,7 @@ protected RabbitMQEndpoint createEndpoint(String uri,
endpoint.setAddresses(getAddresses());
endpoint.setThreadPoolSize(getThreadPoolSize());
endpoint.setExchangeName(exchangeName);
endpoint.setArgs(args);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, I think this is not needed, as this being handled by setProperties(endpoint, params);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is all the point params parameter is always an empty map where args is setting using query parameters is my PR there is something wrong i don't know where i think we have to cleanup this component

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean? What are you trying to fix exactly here? Because I feel we are mixing things up here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I trying to first getting args argument when it passed as query parameters lets just fix this for beginning

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I thought if you pass it like this rabbitmq:foo?queue=foo&arg.queue.x-max-priority=10 it will work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean ? i really didn't understand

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The case is simple how i suppose to translate this weird way &arg.queue.x-max-priority=10 of passing parameter with the new DSL

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this PR, I suggested to remove some lines from the code. This line where we are commenting now and here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is the main point if your remove this line i'll get an empty map

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe if you can try this and i think you'll see what i'm trying to solve

endpoint.setClientProperties(clientProperties);
endpoint.setSslProtocol(getSslProtocol());
endpoint.setTrustManager(trustManager);
Expand Down Expand Up @@ -249,9 +252,9 @@ protected RabbitMQEndpoint createEndpoint(String uri,
}

Map<String, Object> localArgs = new HashMap<>();
if (getArgs() != null) {
if (endpoint.getArgs() != null) {
// copy over the component configured args
localArgs.putAll(getArgs());
localArgs.putAll(endpoint.getArgs());
}
localArgs.putAll(PropertiesHelper.extractProperties(params, ARG_PREFIX));
endpoint.setArgs(localArgs);
Expand Down