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-rabbitmq-source-kafka-connector: Unable to specify vhost #1442

Closed
steve-criticalmention opened this issue Oct 5, 2022 · 4 comments
Closed
Assignees

Comments

@steve-criticalmention
Copy link

In version 3.18 of the rabbitmq-source Kafka connector, there is no option to specify the vhost to be used for RabbitMQ. This leads to errors like this:

Caused by: com.rabbitmq.client.ShutdownSignalException: connection error; protocol method: #method<connection.close>(reply-code=530, reply-text=NOT_ALLOWED - access to vhost '/' refused for user 'guest', class-id=10, method-id=40)

I have tried to append the vhost to the addresses string, after the port specification, but that does not work:

[2022-10-04 22:34:54,673] ERROR [example|task-0] Error starting CamelContext (camel-1) due to exception thrown: For input string: "5672/custom_vhost" (org.apache.camel.impl.engine.AbstractCamelContext:3041)
[Worker-054b406375fec7d19] java.lang.NumberFormatException: For input string: "5672/custom_vhost"

Based on the documentation from an older version of the connector, it seems that vhost was able to be specified by using camel.source.endpoint.vhost, but based on the most recent documentation, it seems that this setting is unavailable.

Is there any way to specify a RabbitMQ vhost using the rabbitmq-source Kafka connector in the most recent version? If there is, then it would be helpful to be documented, and if not, that would be a wonderful addition.

@oscerd oscerd self-assigned this Oct 5, 2022
@oscerd
Copy link
Contributor

oscerd commented Oct 5, 2022

This needs to be done at Kamelet level. In particular here: https://github.com/apache/camel-kamelets/blob/main/kamelets/rabbitmq-source.kamelet.yaml

@oscerd
Copy link
Contributor

oscerd commented Oct 5, 2022

I'll try to add it in the next release.

@steve-criticalmention
Copy link
Author

@oscerd, Thanks for your help.

When you specify the new option, is that because vhost is already part of the camel-rabbitmq component? Of these configuration options in the camel-rabbitmq component, are only the ones that can be added on the Kamelet level, options which don't have a hardcoded default value, and use ConnectionFactory as the default?

With the current configuration options available for the camel-rabbitmq-source-kafka-connector, the queue and exchange is set to auto-delete by default. If the Kafka connector gets disconnected, then the queue/exchange is deleted, along with any messages on the queue and this would lead to data loss. Being able to define the type and features of the exchange/queue would really improve this connector. If this is something you think can be done at the Kamelet level, I could go through and add those options.

Thanks again for your help and guidance

@oscerd
Copy link
Contributor

oscerd commented Oct 6, 2022

In the old implementation of camel Kafka connector we were using the component as generation source. In the new one we are using the Kamelets: a Kamelet is a pre-defined endpoint doing a particular action, this is the reason why we are not mapping all the endpoint and component parameters in the Kamelets anymore.

When there is a request to add something we usually evaluate if it makes sense to add the parameter in an existing Kamelet or, if it makes sense to create new one (like for example, a specialized kamelet for a particular authentication model we support).

If you want to add more parameters just open an issue at camel-kamelets repo and provide a PR. We could discuss there. The next release should be on vote soon, so not sure the PRs you're going to provide will be included.

Thanks for your help and looking forward to your PRs

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

No branches or pull requests

2 participants