Skip to content

Exchange

This class encapsulates and extends the ROS resource type ALIYUN::AMQP::Exchange, which is used to create an exchange.

Initializers

import com.aliyun.ros.cdk.amqp.Exchange;
Exchange.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
    .autoDeleteState(java.lang.Boolean)
    .autoDeleteState(IResolvable)
    .exchangeName(java.lang.String)
    .exchangeName(IResolvable)
    .exchangeType(java.lang.String)
    .exchangeType(IResolvable)
    .instanceId(java.lang.String)
    .instanceId(IResolvable)
    .internal(java.lang.Boolean)
    .internal(IResolvable)
    .virtualHost(java.lang.String)
    .virtualHost(IResolvable)
//  .alternateExchange(java.lang.String)
//  .alternateExchange(IResolvable)
    .build();
Name Type Description
scope com.aliyun.ros.cdk.core.Construct No description.
id java.lang.String No description.
enableResourcePropertyConstraint java.lang.Boolean No description.
autoDeleteState java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property autoDeleteState: Specifies whether the Auto Delete attribute is configured.
exchangeName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property exchangeName: The name of the exchange.
exchangeType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property exchangeType: The type of the exchange.
instanceId java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property instanceId: InstanceId.
internal java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable Property internal: Specifies whether an exchange is an internal exchange.
virtualHost java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property virtualHost: The name of the virtual host.
alternateExchange java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property alternateExchange: The alternate exchange.

scopeRequired

  • Type: com.aliyun.ros.cdk.core.Construct

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

autoDeleteStateRequired

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property autoDeleteState: Specifies whether the Auto Delete attribute is configured.

Valid values: true: The Auto Delete attribute is configured. If the last queue that is bound to an exchange is unbound, the exchange is automatically deleted. false: The Auto Delete attribute is not configured. If the last queue that is bound to an exchange is unbound, the exchange is not automatically deleted.


exchangeNameRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property exchangeName: The name of the exchange.


exchangeTypeRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property exchangeType: The type of the exchange.

Valid values: FANOUT: An exchange of this type routes all the received messages to all the queues bound to this exchange. You can use a fanout exchange to broadcast messages. DIRECT: An exchange of this type routes a message to the queue whose binding key is exactly the same as the routing key of the message. TOPIC: This type is similar to the direct exchange type. An exchange of this type routes a message to one or more queues based on the fuzzy match or multi-condition match result between the routing key of the message and the binding keys of the current exchange. HEADERS: Headers Exchange uses the Headers property instead of Routing Key for routing matching. When binding Headers Exchange and Queue, set the key-value pair of the binding property; when sending a message to the Headers Exchange, set the message's Headers property key-value pair and use the message Headers The message is routed to the bound Queue by comparing the attribute key-value pair and the bound attribute key-value pair.


instanceIdRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property instanceId: InstanceId.


internalRequired

  • Type: java.lang.Boolean OR com.aliyun.ros.cdk.core.IResolvable

Property internal: Specifies whether an exchange is an internal exchange.

Valid values: false: The exchange is not an internal exchange. true: The exchange is an internal exchange.


virtualHostRequired

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property virtualHost: The name of the virtual host.


alternateExchangeOptional

  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Property alternateExchange: The alternate exchange.

An alternate exchange is configured for an existing exchange. It is used to receive messages that fail to be routed to queues from the existing exchange.


Methods

Name Description
toString Returns a string representation of this construct.
synthesize Allows this construct to emit artifacts into the cloud assembly during synthesis.
addCondition No description.
addCount No description.
addDependency No description.
addResourceDesc No description.
applyRemovalPolicy No description.
getAtt No description.
setMetadata No description.

toString

public java.lang.String toString()

Returns a string representation of this construct.

synthesize

public void synthesize(ISynthesisSession session)

Allows this construct to emit artifacts into the cloud assembly during synthesis.

This method is usually implemented by framework-level constructs such as Stack and Asset as they participate in synthesizing the cloud assembly.

sessionRequired

  • Type: com.aliyun.ros.cdk.core.ISynthesisSession

The synthesis session.


addCondition

public void addCondition(RosCondition condition)

conditionRequired

  • Type: com.aliyun.ros.cdk.core.RosCondition

addCount

public void addCount(java.lang.Number OR IResolvable count)

countRequired

  • Type: java.lang.Number OR com.aliyun.ros.cdk.core.IResolvable

addDependency

public void addDependency(Resource resource)

resourceRequired

  • Type: com.aliyun.ros.cdk.core.Resource

addResourceDesc

public void addResourceDesc(java.lang.String desc)

descRequired

  • Type: java.lang.String

applyRemovalPolicy

public void applyRemovalPolicy(RemovalPolicy policy)

policyRequired

  • Type: com.aliyun.ros.cdk.core.RemovalPolicy

getAtt

public IResolvable getAtt(java.lang.String name)

nameRequired

  • Type: java.lang.String

setMetadata

public void setMetadata(java.lang.String key, java.lang.Object value)

keyRequired

  • Type: java.lang.String

valueRequired

  • Type: java.lang.Object

Static Functions

Name Description
isConstruct Return whether the given object is a Construct.

isConstruct

import com.aliyun.ros.cdk.amqp.Exchange;
Exchange.isConstruct(java.lang.Object x)

Return whether the given object is a Construct.

xRequired

  • Type: java.lang.Object

Properties

Name Type Description
node com.aliyun.ros.cdk.core.ConstructNode The construct tree node associated with this construct.
ref java.lang.String No description.
stack com.aliyun.ros.cdk.core.Stack The stack in which this resource is defined.
resource com.aliyun.ros.cdk.core.RosResource No description.
attrExchangeName com.aliyun.ros.cdk.core.IResolvable Attribute ExchangeName: The name of the exchange.

nodeRequired

public ConstructNode getNode();
  • Type: com.aliyun.ros.cdk.core.ConstructNode

The construct tree node associated with this construct.


refRequired

public java.lang.String getRef();
  • Type: java.lang.String

stackRequired

public Stack getStack();
  • Type: com.aliyun.ros.cdk.core.Stack

The stack in which this resource is defined.


resourceOptional

public RosResource getResource();
  • Type: com.aliyun.ros.cdk.core.RosResource

attrExchangeNameRequired

public IResolvable getAttrExchangeName();
  • Type: com.aliyun.ros.cdk.core.IResolvable

Attribute ExchangeName: The name of the exchange.