Package org.springframework.amqp.core
Class ExchangeBuilder
- java.lang.Object
-
- org.springframework.amqp.core.AbstractBuilder
-
- org.springframework.amqp.core.ExchangeBuilder
-
public final class ExchangeBuilder extends AbstractBuilder
Builder providing a fluent API for buildingExchange
s.- Since:
- 1.6
- Author:
- Gary Russell, Artem Bilan
-
-
Constructor Summary
Constructors Constructor Description ExchangeBuilder(String name, String type)
Construct an instance of the appropriate type.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ExchangeBuilder
admins(Object... admins)
Admin instances, or admin bean names that should declare this exchange.ExchangeBuilder
alternate(String exchange)
ExchangeBuilder
autoDelete()
Set the auto delete flag.<T extends Exchange>
Tbuild()
ExchangeBuilder
delayed()
Set the delayed flag.static ExchangeBuilder
directExchange(String name)
Return aDirectExchange
builder.ExchangeBuilder
durable(boolean isDurable)
Set the durable flag.static ExchangeBuilder
fanoutExchange(String name)
Return aFanoutExchange
builder.static ExchangeBuilder
headersExchange(String name)
Return aHeadersExchange
builder.ExchangeBuilder
ignoreDeclarationExceptions()
Switch on ignore exceptions such as mismatched properties when declaring.ExchangeBuilder
internal()
Set the internal flag.ExchangeBuilder
suppressDeclaration()
Switch to disable declaration of the exchange by any admin.static ExchangeBuilder
topicExchange(String name)
Return aTopicExchange
builder.ExchangeBuilder
withArgument(String key, Object value)
Add an argument.ExchangeBuilder
withArguments(Map<String,Object> arguments)
Add the arguments.-
Methods inherited from class org.springframework.amqp.core.AbstractBuilder
getArguments, getOrCreateArguments
-
-
-
-
Constructor Detail
-
ExchangeBuilder
public ExchangeBuilder(String name, String type)
Construct an instance of the appropriate type.- Parameters:
name
- the exchange nametype
- the type name- Since:
- 1.6.7
- See Also:
ExchangeTypes
-
-
Method Detail
-
directExchange
public static ExchangeBuilder directExchange(String name)
Return aDirectExchange
builder.- Parameters:
name
- the name.- Returns:
- the builder.
-
topicExchange
public static ExchangeBuilder topicExchange(String name)
Return aTopicExchange
builder.- Parameters:
name
- the name.- Returns:
- the builder.
-
fanoutExchange
public static ExchangeBuilder fanoutExchange(String name)
Return aFanoutExchange
builder.- Parameters:
name
- the name.- Returns:
- the builder.
-
headersExchange
public static ExchangeBuilder headersExchange(String name)
Return aHeadersExchange
builder.- Parameters:
name
- the name.- Returns:
- the builder.
-
autoDelete
public ExchangeBuilder autoDelete()
Set the auto delete flag.- Returns:
- the builder.
-
durable
public ExchangeBuilder durable(boolean isDurable)
Set the durable flag.- Parameters:
isDurable
- the durable flag (default true).- Returns:
- the builder.
-
withArgument
public ExchangeBuilder withArgument(String key, Object value)
Add an argument.- Parameters:
key
- the argument key.value
- the argument value.- Returns:
- the builder.
-
withArguments
public ExchangeBuilder withArguments(Map<String,Object> arguments)
Add the arguments.- Parameters:
arguments
- the arguments map.- Returns:
- the builder.
-
alternate
public ExchangeBuilder alternate(String exchange)
-
internal
public ExchangeBuilder internal()
Set the internal flag.- Returns:
- the builder.
-
delayed
public ExchangeBuilder delayed()
Set the delayed flag.- Returns:
- the builder.
-
ignoreDeclarationExceptions
public ExchangeBuilder ignoreDeclarationExceptions()
Switch on ignore exceptions such as mismatched properties when declaring.- Returns:
- the builder.
- Since:
- 2.0
-
suppressDeclaration
public ExchangeBuilder suppressDeclaration()
Switch to disable declaration of the exchange by any admin.- Returns:
- the builder.
- Since:
- 2.1
-
admins
public ExchangeBuilder admins(Object... admins)
Admin instances, or admin bean names that should declare this exchange.- Parameters:
admins
- the admins.- Returns:
- the builder.
- Since:
- 2.1
-
build
public <T extends Exchange> T build()
-
-