W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
可以通過接收消息來觸發(fā)輸出消息,如以下示例所示:
Groovy DSL。
def dsl = Contract.make { description 'Some Description' label 'some_label' // input is a message input { // the message was received from this destination messageFrom('input') // has the following body messageBody([ bookName: 'foo' ]) // and the following headers messageHeaders { header('sample', 'header') } } outputMessage { sentTo('output') body([ bookName: 'foo' ]) headers { header('BOOK-NAME', 'foo') } } }
YAML。
# Human readable description description: Some description # Label by means of which the output message can be triggered label: some_label # input is a message input: messageFrom: input # has the following body messageBody: bookName: 'foo' # and the following headers messageHeaders: sample: 'header' # output message of the contract outputMessage: # destination to which the output message will be sent sentTo: output # the body of the output message body: bookName: foo # the headers of the output message headers: BOOK-NAME: foo
在前面的示例中,如果在input
目標(biāo)上收到了適當(dāng)?shù)南?,則將輸出消息發(fā)送到output
。在消息發(fā)布者側(cè),引擎生成一個(gè)測試,將該輸入消息發(fā)送到定義的目的地。在
使用者方面,您可以將消息發(fā)送到輸入目標(biāo),也可以使用標(biāo)簽(示例中為some_label
)來觸發(fā)消息。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: