THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
@Bean AMQPConnectionDetails amqpConnection() { return new AMQPConnectionDetails("amqp://lcoalhost:5672"); } @Bean AMQPConnectionDetails securedAmqpConnection() { return new AMQPConnectionDetails("amqp://lcoalhost:5672", "username", "password"); } |
You can also rely on the Camel properties to read the AMQP connection details. Factory method AMQPConnectionDetails.discoverAMQP()
attempts to read Camel properties in a Kubernetes-like convention, just as demonstrated on the snippet below:
Code Block | ||||
---|---|---|---|---|
| ||||
export AMQP_SERVICE_HOST = "mybroker.com"
export AMQP_SERVICE_PORT = "6666"
export AMQP_SERVICE_USERNAME = "username"
export AMQP_SERVICE_PASSWORD = "password"
...
@Bean
AMQPConnectionDetails amqpConnection() {
return AMQPConnectionDetails.discoverAMQP();
}
|
Using topics
To have using topics working with camel-amqp
you need to configure the component to use topic://
as topic prefix, as shown below:
...