Search in sources :

Example 1 with Identifier

use of io.smallrye.common.annotation.Identifier in project smallrye-reactive-messaging by smallrye.

the class RabbitMQProducers method getNamedOptions.

// <named>
@Produces
@Identifier("my-named-options")
public RabbitMQOptions getNamedOptions() {
    // You can use the produced options to configure the TLS connection
    PemKeyCertOptions keycert = new PemKeyCertOptions().addCertPath("./tls/tls.crt").addKeyPath("./tls/tls.key");
    PemTrustOptions trust = new PemTrustOptions().addCertPath("./tlc/ca.crt");
    return (RabbitMQOptions) new RabbitMQOptions().setUser("admin").setPassword("test").setSsl(true).setPemKeyCertOptions(keycert).setPemTrustOptions(trust).setHostnameVerificationAlgorithm("").setConnectTimeout(30000).setReconnectInterval(5000);
}
Also used : RabbitMQOptions(io.vertx.rabbitmq.RabbitMQOptions) PemKeyCertOptions(io.vertx.core.net.PemKeyCertOptions) PemTrustOptions(io.vertx.core.net.PemTrustOptions) Identifier(io.smallrye.common.annotation.Identifier) Produces(javax.enterprise.inject.Produces)

Example 2 with Identifier

use of io.smallrye.common.annotation.Identifier in project smallrye-reactive-messaging by smallrye.

the class ClientProducers method getNamedOptions.

// <named>
@Produces
@Identifier("my-named-options")
public AmqpClientOptions getNamedOptions() {
    // You can use the produced options to configure the TLS connection
    PemKeyCertOptions keycert = new PemKeyCertOptions().addCertPath("./tls/tls.crt").addKeyPath("./tls/tls.key");
    PemTrustOptions trust = new PemTrustOptions().addCertPath("./tlc/ca.crt");
    return new AmqpClientOptions().setSsl(true).setPemKeyCertOptions(keycert).setPemTrustOptions(trust).addEnabledSaslMechanism("EXTERNAL").setHostnameVerificationAlgorithm("").setConnectTimeout(30000).setReconnectInterval(5000).setContainerId("my-container");
}
Also used : PemKeyCertOptions(io.vertx.core.net.PemKeyCertOptions) AmqpClientOptions(io.vertx.amqp.AmqpClientOptions) PemTrustOptions(io.vertx.core.net.PemTrustOptions) Identifier(io.smallrye.common.annotation.Identifier) Produces(javax.enterprise.inject.Produces)

Aggregations

Identifier (io.smallrye.common.annotation.Identifier)2 PemKeyCertOptions (io.vertx.core.net.PemKeyCertOptions)2 PemTrustOptions (io.vertx.core.net.PemTrustOptions)2 Produces (javax.enterprise.inject.Produces)2 AmqpClientOptions (io.vertx.amqp.AmqpClientOptions)1 RabbitMQOptions (io.vertx.rabbitmq.RabbitMQOptions)1