File tree Expand file tree Collapse file tree 5 files changed +17
-7
lines changed
Expand file tree Collapse file tree 5 files changed +17
-7
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ workflows:
7777 context : org-global
7878 filters :
7979 branches :
80- only : ['dev']
80+ only : ['dev', 'feature/shapeup3' ]
8181 - " build-prod " :
8282 context : org-global
8383 filters :
Original file line number Diff line number Diff line change 11# Topcoder Bus API Server
22
3- ## Overview
3+ ## Overview
44
55A meta service, Topcoder Bus API server provides information about other services offered by Topcoder.
66
Original file line number Diff line number Diff line change @@ -979,6 +979,10 @@ definitions:
979979 type : " string"
980980 example : " application/json"
981981 description : " Mime-type for 'payload'.\n "
982+ key :
983+ type : " string"
984+ example : " abc123"
985+ description : " optional field to assure the one partition for 'payload'.\n "
982986 payload :
983987 type : " object"
984988 example :
Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ function validateEventPayload (event) {
133133 originator : Joi . string ( ) . required ( ) ,
134134 timestamp : Joi . string ( ) . required ( ) ,
135135 'mime-type' : Joi . string ( ) . required ( ) ,
136+ key : Joi . string ( ) ,
136137 payload : Joi . any ( )
137138 } )
138139 } )
Original file line number Diff line number Diff line change @@ -30,12 +30,17 @@ async function postEvent (event) {
3030 helper . validateEventPayload ( event )
3131
3232 // Post new structure
33- const result = await producer . send ( {
33+ const message = {
34+ value : JSON . stringify ( event )
35+ }
36+ if ( event . key ) {
37+ _ . merge ( message , { key : event . key } )
38+ }
39+ const kafkaPayload = {
3440 topic : event . topic ,
35- message : {
36- value : JSON . stringify ( event )
37- }
38- } )
41+ message
42+ }
43+ const result = await producer . send ( kafkaPayload )
3944 // Check if there is any error
4045 const error = _ . get ( result , '[0].error' )
4146 if ( error ) {
You can’t perform that action at this time.
0 commit comments