Search in sources :

Example 1 with DestinationType

use of org.springframework.amqp.core.Binding.DestinationType in project spring-amqp by spring-projects.

the class BindingFactoryBean method getObject.

@Override
public Binding getObject() {
    String destination;
    DestinationType destinationType;
    if (this.destinationQueue != null) {
        destination = this.destinationQueue.getName();
        destinationType = DestinationType.QUEUE;
    } else {
        destination = this.destinationExchange.getName();
        destinationType = DestinationType.EXCHANGE;
    }
    Binding binding = new Binding(destination, destinationType, this.exchange, this.routingKey, this.arguments);
    if (this.shouldDeclare != null) {
        binding.setShouldDeclare(this.shouldDeclare);
    }
    if (this.ignoreDeclarationExceptions != null) {
        binding.setIgnoreDeclarationExceptions(this.ignoreDeclarationExceptions);
    }
    if (this.adminsThatShouldDeclare != null) {
        binding.setAdminsThatShouldDeclare((Object[]) this.adminsThatShouldDeclare);
    }
    return binding;
}
Also used : Binding(org.springframework.amqp.core.Binding) DestinationType(org.springframework.amqp.core.Binding.DestinationType)

Aggregations

Binding (org.springframework.amqp.core.Binding)1 DestinationType (org.springframework.amqp.core.Binding.DestinationType)1