Search in sources :

Example 1 with DefaultStreamMessageConverter

use of org.springframework.rabbit.stream.support.converter.DefaultStreamMessageConverter in project spring-amqp by spring-projects.

the class RabbitStreamTemplate method createOrGetProducer.

private synchronized Producer createOrGetProducer() {
    if (this.producer == null) {
        ProducerBuilder builder = this.environment.producerBuilder();
        builder.stream(this.streamName);
        this.producerCustomizer.accept(this.beanName, builder);
        this.producer = builder.build();
        if (!this.streamConverterSet) {
            ((DefaultStreamMessageConverter) this.streamConverter).setBuilderSupplier(() -> this.producer.messageBuilder());
        }
    }
    return this.producer;
}
Also used : ProducerBuilder(com.rabbitmq.stream.ProducerBuilder) DefaultStreamMessageConverter(org.springframework.rabbit.stream.support.converter.DefaultStreamMessageConverter)

Aggregations

ProducerBuilder (com.rabbitmq.stream.ProducerBuilder)1 DefaultStreamMessageConverter (org.springframework.rabbit.stream.support.converter.DefaultStreamMessageConverter)1