Creates an EventStreaming.
URL
/eventstreaming/createEventStreaming
Usage notes
- In an EventStreaming, you can specify only one of the SourceMNSParameters, SourceRocketMQParameters, and SourceRabbitMQParameters parameters.
- In an EventStreaming, you can specify only one of the SinkMNSParameters, SinkRocketMQParameters, and SinkRabbitMQParameters parameters.
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
EventStreamingName | String | Yes | myeventstreaming | The name of the EventStreaming. |
Description | String | Yes | rocketmq2mns | The description of the EventStreaming. |
Source | Object | Yes | SourceRocketMQParameters | The information about the event provider. |
SourceMNSParameters | Object | No | The resource information that you configure when the event provider is MNS. For more information, see Request parameter SourceMNSParameters. | |
SourceRocketMQParameters | Object | No | The resource information that you configure when the event provider is Message Queue for Apache RocketMQ. For more information, see Request parameter SourceRocketMQParameters. | |
SourceRabbitMQParameters | Object | No | The resource information that you configure when the event provider is Message Queue for RabbitMQ. For more information, see Request parameter SourceRabbitMQParameters. | |
FilterPattern | String | No | N/A | The event rule. If you leave this parameter empty, all events are matched. |
Sink | Object | Yes | SinkMNSParameters | The information about the event target. |
SinkMNSParameters | Object | No | The resource information that you configure when the event target is MNS. For more information, see Request parameter SinkMNSParameters. | |
SinkRocketMQParameters | Object | No | The resource information that you configure when the event target is Message Queue for Apache RocketMQ. For more information, see Request parameter SinkRocketMQParameters. | |
SinkRabbitMQParameters | Object | No | The resource information that you configure when the event target is Message Queue for RabbitMQ. For more information, see Request parameter SinkRabbitMQParameters. | |
RunOptions | Object | No | The runtime environment. | |
RetryStrategy | String | Yes | BACKOFF_RETRY | The retry policy to be used when an event fails to be pushed. Valid values:
Default value: BACKOFF_RETRY. |
ErrorsTolerance | String | Yes | ALL | The fault tolerance policy, which specifies whether to ignore an error when it occurs.
Valid values:
Default value: ALL. |
DeadLetterQueue | Object | Yes | Specifies whether to enable dead-letter queues. By default, dead-letter queues are disabled. Messages that fail to be pushed after allowed retries as specified by the retry policy are discarded. | |
Arn | String | No | acs:mq:cn-chengdu:164901546557****:/instances/MQ_INST_164901546557****_BXxk0KXx/topic/Mytopic | The Alibaba Cloud Resource Name (ARN) of the topic in the Message Queue for RabbitMQ instance. |
Request parameter SourceMNSParameters
If you specify the SourceMNSParameters parameter, you can set the parameters described in the following table.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
QueueName | String | Yes | demo | The name of the queue in the MNS instance. |
IsBase64Decode | String | Yes | true | Specifies whether to enable Base64 decoding. Default value: true. |
Request parameter SourceRocketMQParameters
If you specify the SourceRocketMQParameters parameter, you can set the parameters described in the following table.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
RegionId | String | Yes | cn-hangzhou | The ID of the region where the Message Queue for Apache RocketMQ instance resides. |
InstanceId | String | Yes | MQ_INST_164901546557****_BAAN**** | The ID of the Message Queue for Apache RocketMQ instance. For more information, see Limits. |
Topic | String | Yes | mytopic | The name of the topic in the Message Queue for Apache RocketMQ instance. For more information, see Limits. |
Tag | String | No | test | The tags for filtering. |
Offset | String | No | CONSUME_FROM_TIMESTAMP | The consumer offset of the message. Valid values:
Default value: CONSUME_FROM_LAST_OFFSET. |
Timestamp | Long | No | 1636597951964 | The timestamp of the offset from which the consumption starts. This parameter is valid only when you set the Offset parameter to CONSUME_FROM_TIMESTAMP. |
GroupID | String | Yes | GID_group1 | The group ID of the Message Queue for Apache RocketMQ instance. |
Request parameter SourceRabbitMQParameters
If you specify the SourceRabbitMQParameters parameter, you can set the parameters described in the following table.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
InstanceId | String | Yes | amqp-cn-nif22u74**** | The ID of the Message Queue for RabbitMQ instance. For more information, see Limits. |
VirtualHostName | String | Yes | eb-connect | The name of the vhost in the Message Queue for RabbitMQ instance. For more information, see Limits. |
QueueName | String | Yes | demo | The name of the queue in the Message Queue for RabbitMQ instance. For more information, see Limits. |
Request parameter SinkMNSParameters
If you specify the SinkMNSParameters parameter, you can set the parameters described in the following table.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
QueueName | TargetParameter | Yes | The name of the queue that you specify when the event target is MNS. | |
Value | String | Yes | MyQueue | The name of the queue in the MNS instance. |
Form | String | No | CONSTANT | The transformation method. Default value: CONSTANT. |
Body | TargetParameter | No | The content of the message. | |
Form | String | No | TEMPLATE | The transformation method. |
Value | String | Yes |
|
The value before the transformation. |
Template | String | No | The value of ${key} is ${value}! | The template based on which events are to be transformed. |
IsBase64Encode | TargetParameter | Yes | Specifies whether to enable Base64 encoding. | |
Value | String | Yes | true | Specifies whether to enable Base64 encoding. |
Form | String | No | CONSTANT | The transformation method. Default value: CONSTANT. |
Request parameter SinkRocketMQParameters
If you specify the SinkRocketMQParameters parameter, you can set the parameters described in the following table.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
InstanceId | TargetParameter | Yes | The ID of the Message Queue for Apache RocketMQ instance that you specify when the event target is Message Queue for Apache RocketMQ. | |
Value | String | Yes | MQ_INST_164901546557****_BAAN**** | The ID of the Message Queue for Apache RocketMQ instance. For more information, see Limits. |
Form | String | No | CONSTANT | The transformation method. Default value: CONSTANT. |
Topic | TargetParameter | Yes | The topic in the Message Queue for Apache RocketMQ instance. | |
Value | String | Yes | Mytopic | The name of the topic in the Message Queue for Apache RocketMQ instance. For more information, see Limits. |
Form | String | No | CONSTANT | The transformation method. Default value: CONSTANT. |
Body | TargetParameter | Yes | The content of the message. | |
Form | String | No | N/A | The transformation method. Default value: TEMPLATE. |
Value | String | Yes |
|
The value before the transformation. |
Template | String | Yes | The value of ${key} is ${value}! | The template based on which events are to be transformed. |
Properties | TargetParameter | Yes | The properties for filtering. | |
Value | String | Yes |
|
The value before the transformation. |
Form | String | No | TEMPLATE | The transformation method. |
Template | String | Yes | The value of ${key} is ${value}! | The template based on which events are to be transformed. |
Keys | TargetParameter | Yes | The keys for filtering. | |
Value | String | Yes |
|
The value before the transformation. |
Form | String | No | TEMPLATE | The transformation method. |
Template | String | Yes | The value of ${key} is ${value}! | The template based on which events are to be transformed. |
Tags | TargetParameter | Yes | The tags for filtering. | |
Value | String | Yes |
|
The value before the transformation. |
Form | String | No | TEMPLATE | The transformation method. |
Template | String | Yes | The value of ${key} is ${value}! | The template based on which events are to be transformed. |
Request parameter SinkRabbitMQParameters
If you specify the SinkRabbitMQParameters parameter, you can set the parameters described in the following table.
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
InstanceId | TargetParameter | Yes | The ID of the Message Queue for RabbitMQ instance that you specify when the event target is Message Queue for RabbitMQ. | |
Value | String | Yes | amqp-cn-2r42e73o**** | The ID of the Message Queue for RabbitMQ instance. For more information, see Limits. |
Form | String | No | CONSTANT | The transformation method. Default value: CONSTANT. |
VirtualHostName | TargetParameter | Yes | The name of the vhost in the Message Queue for RabbitMQ instance. | |
Value | String | Yes | rabbit-host | The name of the vhost in the Message Queue for RabbitMQ instance. For more information, see Limits. |
Form | String | No | CONSTANT | The transformation method. Default value: CONSTANT. |
TargetType | TargetParameter | Yes | The type of the resource to which events are to be pushed. | |
Value | String | Yes | Exchange/Queue | The type of the resource to which events are to be pushed. Valid values:
|
Form | String | No | CONSTANT | The transformation method. Default value: CONSTANT. |
Exchange | TargetParameter | Yes | The name of the exchange to which events are to be pushed in the destination instance.
This parameter is valid only when you set the TargetType parameter to Exchange. |
|
Value | String | Yes | a_exchange | The name of the exchange in the Message Queue for RabbitMQ instance. For more information, see Limits. |
Form | String | No | CONSTANT | The transformation method. Default value: CONSTANT. |
RoutingKey | TargetParameter | Yes | The routing rule of the message.
This parameter is valid only when you set the TargetType parameter to Exchange. |
|
Value | String | Yes | housekeeping | The routing rule of the message. |
Form | String | No | CONSTANT | The transformation method. Default value: CONSTANT. |
QueueName | TargetParameter | Yes | The name of the queue to which events are pushed in the destination instance.
This parameter is valid only when you set the TargetType parameter to Queue. |
|
Value | String | Yes | MyQueue | The name of the queue in the Message Queue for RabbitMQ instance. For more information, see Limits. |
Form | String | No | CONSTANT | The transformation method. Default value: CONSTANT. |
Body | TargetParameter | Yes | The content of the message. | |
Form | String | No | TEMPLATE | The transformation method. |
Value | String | Yes |
|
The value before the transformation. |
Template | String | No | The value of ${key} is ${value}! | The template based on which events are to be transformed. |
MessageId | TargetParameter | Yes | The ID of the message. | |
Value | String | Yes |
|
The value before the transformation. |
Form | String | No | TEMPLATE | The transformation method. |
Template | String | Yes | The value of ${key} is ${value}! | The template based on which events are to be transformed. |
Properties | TargetParameter | Yes | The properties for filtering. | |
Value | String | Yes |
|
The value before the transformation. |
Form | String | No | TEMPLATE | The transformation method. |
Template | String | Yes | The value of ${key} is ${value}! | The template based on which events are to be transformed. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
EventStreamingARN | String | acs:eventbridge:cn-hangzhou:164901546557****:eventstreaming/myeventstreaming | The ARN of the EventStreaming. |
Examples
In the following sample requests and responses, events are routed from the custom event source of the Message Queue for Apache RocketMQ type to the event target MNS.
Sample requests
POST /eventstreaming/creatEventStreaming HTTP/1.1
Host: 164901546557****.eventbridge.cn-hangzhou.aliyuncs.com
Date: Sat, 18 Apr 2020 05:30:41 GMT
x-eventbridge-version: 2020-04-01
Authorization: acs vZ3VL0SuJdHi****:Jo2PbT******azYAYoYslKLvWzg=
Content-Type: application/json;charset=UTF-8
Content-Length: 26
{
"EventStreamingName":"myeventstreaming",
"Description":"rocketmq2mns",
"FilterPattern":"{}",
"Source":{
"SourceRocketMQParameters":{
"InstanceId":"MQ_INST_164901546557****_BAAN****",
"GroupID":"GID_group1",
"Topic":"mytopic",
"Offset":"CONSUME_FROM_TIMESTAMP",
"Tag":"",
"RegionId":"cn-hangzhou",
"Timestamp":1636597951964
}
},
"Sink":{
"SinkMNSParameters":{
"QueueName":{
"Value":"MyQueue",
"Form":"CONSTANT"
},
"IsBase64Encode":{
"Value":"true",
"Form":"CONSTANT"
},
"Body":{
"Value":{
"key":"value"
},
"Form":"TEMPLATE",
"Template":"The value of ${key} is ${value}!"
}
}
},
"RunOptions":{
"ErrorsTolerance":"ALL",
"RetryStrategy":{
"PushRetryStrategy":"BACKOFF_RETRY"
},
"DeadLetterQueue":{
"Arn":"acs:mq:cn-chengdu:164901546557****:/instances/MQ_INST_164901546557****_BXxk0KXx/topic/Mytopic"
}
}
}
Sample responses
HTTP/1.1 200 OK
Server: AliyunEventBridge
Connection: keep-alive
Content-Type: application/json;charset=utf-8
Content-Length: 79
x-eventbridge-request-id: 244BED53-719A-15D7-B7F9-1C404273****
Date: Sat, 18 Apr 2020 05:30:41 GMT
{
"code":"200",
"data":{
"RequestId":"244BED53-719A-15D7-B7F9-1C404273****",
"Data":{
"EventStreamingARN":"acs:eventbridge:cn-hangzhou:164901546557****:eventstreaming/myeventstreaming"
},
"Code":"Success",
"Success":true
},
"httpStatusCode":"200",
"requestId":"244BED53-719A-15D7-B7F9-1C404273****",
"successResponse":true
}