Skip to content

Subscription

This class encapsulates and extends the ROS resource type ALIYUN::MNS::Subscription, which is used to describe a subscription relationship, including the subscribed topic and the endpoint that the subscriber uses to receive messages.

Initializers

import com.aliyun.ros.cdk.mns.Subscription;
Subscription.Builder.create(Construct scope, java.lang.String id, java.lang.Boolean enableResourcePropertyConstraint)
    .endpoint(java.lang.String)
    .endpoint(IResolvable)
    .subscriptionName(java.lang.String)
    .subscriptionName(IResolvable)
    .topicName(java.lang.String)
    .topicName(IResolvable)
//  .dlqPolicy(IResolvable)
//  .dlqPolicy(DlqPolicyProperty)
//  .filterTag(java.lang.String)
//  .filterTag(IResolvable)
//  .notifyContentFormat(java.lang.String)
//  .notifyContentFormat(IResolvable)
//  .notifyStrategy(java.lang.String)
//  .notifyStrategy(IResolvable)
//  .pushType(java.lang.String)
//  .pushType(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.
endpoint java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property endpoint: The message delivery endpoint.
subscriptionName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property subscriptionName: Subscription name.
topicName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property topicName: Topic name.
dlqPolicy com.aliyun.ros.cdk.core.IResolvable OR DlqPolicyProperty Property dlqPolicy: Dead-letter queue policy.
filterTag java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property filterTag: Message filter tag in the created subscription (Only messages with consistent tags are pushed.) The value is a string of no more than 16 characters. The default value is no message filter.
notifyContentFormat java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property notifyContentFormat: Format of the message content pushed to the endpoint.
notifyStrategy java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property notifyStrategy: Retry policy that will be applied when an error occurs during message push to the endpoint.
pushType java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Property pushType: Push type of the created subscription.

scopeRequired

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

idRequired

  • Type: java.lang.String

enableResourcePropertyConstraintOptional

  • Type: java.lang.Boolean

endpointRequired

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

Property endpoint: The message delivery endpoint.

The format varies based on the PushType value:

  • If PushType is http: An HTTP/HTTPS callback URL, such as http:\/\/example.com\/callback or https:\/\/example.com\/callback.
  • If PushType is queue: The ARN of the destination queue, in the format acs:mns:{RegionId}:{account ID}:queues\/{QueueName}.
  • If PushType is dm: The endpoint for email push, in the fixed format smq-ep:dm:{account ID}:__dynamic. Replace {account ID} with your account ID.
  • If PushType is dysms: The endpoint for SMS push, in the format smq-ep:dysms:{account ID}:{MobileNumber}.
  • If PushType is kafka: The Kafka push endpoint.
  • If PushType is fc: The endpoint for Function Compute, in the format acs:fc:{RegionId}:{account ID}:services\/{ServiceName}\/functions\/{FunctionName}.
  • If PushType is eventbus: The endpoint for EventBridge, in the format acs:eventbridge:{RegionId}:{account ID}:eventbus\/{EventBusName}.

subscriptionNameRequired

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

Property subscriptionName: Subscription name.


topicNameRequired

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

Property topicName: Topic name.


dlqPolicyOptional

Property dlqPolicy: Dead-letter queue policy.


filterTagOptional

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

Property filterTag: Message filter tag in the created subscription (Only messages with consistent tags are pushed.) The value is a string of no more than 16 characters. The default value is no message filter.


notifyContentFormatOptional

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

Property notifyContentFormat: Format of the message content pushed to the endpoint.

XML, JSON, or SIMPLIFIED; default value: XML. For details about message formats, refer to Basic Concepts/NotifyContentFormat.


notifyStrategyOptional

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

Property notifyStrategy: Retry policy that will be applied when an error occurs during message push to the endpoint.

BACKOFF_RETRY or EXPONENTIAL_DECAY_RETRY; default value: BACKOFF_RETRY. For details about retry policies, refer to Basic Concepts/NotifyStrategy.


pushTypeOptional

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

Property pushType: Push type of the created subscription.


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.
fetchCondition No description.
fetchDependency No description.
fetchResourceDesc 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

fetchCondition

public RosCondition fetchCondition()

fetchDependency

public java.util.List<java.lang.String> fetchDependency()

fetchResourceDesc

public java.lang.String fetchResourceDesc()

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.mns.Subscription;
Subscription.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.
env com.aliyun.ros.cdk.core.IResourceEnvironment The environment this resource belongs to.
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.
attrSubscriptionName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute SubscriptionName: Subscription name.
attrSubscriptionUrl java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute SubscriptionUrl: URL of created subscription.
attrTopicName java.lang.String OR com.aliyun.ros.cdk.core.IResolvable Attribute TopicName: Topic name.
props SubscriptionProps No description.

nodeRequired

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

The construct tree node associated with this construct.


envRequired

public IResourceEnvironment getEnv();
  • Type: com.aliyun.ros.cdk.core.IResourceEnvironment

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.


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

attrSubscriptionNameRequired

public java.lang.Object getAttrSubscriptionName();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute SubscriptionName: Subscription name.


attrSubscriptionUrlRequired

public java.lang.Object getAttrSubscriptionUrl();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute SubscriptionUrl: URL of created subscription.


attrTopicNameRequired

public java.lang.Object getAttrTopicName();
  • Type: java.lang.String OR com.aliyun.ros.cdk.core.IResolvable

Attribute TopicName: Topic name.


propsRequired

public SubscriptionProps getProps();