@@ -51,7 +51,7 @@ const Enum = require('./enum')
5151 * @enum {object} ENUMS~PRODUCER
5252 * @property {string } PRODUCER - PRODUCER config to be fetched
5353 */
54- const PRODUCER = 'PRODUCER'
54+ // const PRODUCER = 'PRODUCER'
5555/**
5656 * The Consumer config required
5757 *
@@ -115,7 +115,7 @@ const STATE = {
115115 * @property {string } CONSUMER - This ENUM is for the CONSUMER
116116 */
117117const ENUMS = {
118- PRODUCER ,
118+ // PRODUCER,
119119 CONSUMER ,
120120 NOTIFICATION ,
121121 STATE ,
@@ -274,24 +274,24 @@ const createState = (status, code, description) => {
274274 }
275275}
276276
277- /**
278- * @function createGeneralTopicConfig
279- *
280- * @param {string } functionality - the functionality flow. Example: 'transfer' ie: note the case of text
281- * @param {string } action - the action that applies to the flow. Example: 'prepare' ie: note the case of text
282- * @param {number } partition - optional partition to produce to
283- * @param {* } opaqueKey - optional opaque token, which gets passed along to your delivery reports
284- *
285- * @returns {object } - Returns newly created general topicConfig
286- */
287- const createGeneralTopicConf = ( functionality , action , partition = 0 , opaqueKey = 0 ) => {
288- return {
289- topicName : transformGeneralTopicName ( functionality , action ) ,
290- key : Uuid ( ) ,
291- partition,
292- opaqueKey
293- }
294- }
277+ // / **
278+ // * @function createGeneralTopicConfig
279+ // *
280+ // * @param {string } functionality - the functionality flow. Example: 'transfer' ie: note the case of text
281+ // * @param {string } action - the action that applies to the flow. Example: 'prepare' ie: note the case of text
282+ // * @param {number } partition - optional partition to produce to
283+ // * @param {* } opaqueKey - optional opaque token, which gets passed along to your delivery reports
284+ // *
285+ // * @returns {object } - Returns newly created general topicConfig
286+ // */
287+ // const createGeneralTopicConf = (functionality, action, partition = 0, opaqueKey = 0) => {
288+ // return {
289+ // topicName: transformGeneralTopicName(functionality, action),
290+ // key: Uuid(),
291+ // partition,
292+ // opaqueKey
293+ // }
294+ // }
295295
296296/**
297297 * @function produceGeneralMessage
@@ -311,22 +311,23 @@ const createGeneralTopicConf = (functionality, action, partition = 0, opaqueKey
311311 *
312312 * @returns {object } - Returns a boolean: true if successful, or throws and error if failed
313313 */
314- const produceGeneralMessage = async ( functionality , action , message , state ) => {
315- let functionalityMapped = functionality
316- let actionMapped = action
317- if ( Enum . topicMap [ functionality ] && Enum . topicMap [ functionality ] [ action ] ) {
318- functionalityMapped = Enum . topicMap [ functionality ] [ action ] . functionality
319- actionMapped = Enum . topicMap [ functionality ] [ action ] . action
320- }
321- await Kafka . Producer . produceMessage ( updateMessageProtocolMetadata ( message , functionality , action , state ) ,
322- createGeneralTopicConf ( functionalityMapped , actionMapped ) ,
323- getKafkaConfig ( ENUMS . PRODUCER , functionalityMapped . toUpperCase ( ) , actionMapped . toUpperCase ( ) ) )
324- }
314+ // const produceGeneralMessage = async (functionality, action, message, state) => {
315+ // let functionalityMapped = functionality
316+ // let actionMapped = action
317+ // if (Enum.topicMap[functionality] && Enum.topicMap[functionality][action]) {
318+ // functionalityMapped = Enum.topicMap[functionality][action].functionality
319+ // actionMapped = Enum.topicMap[functionality][action].action
320+ // }
321+ // await Kafka.Producer.produceMessage(updateMessageProtocolMetadata(message, functionality, action, state),
322+ // createGeneralTopicConf(functionalityMapped, actionMapped),
323+ // getKafkaConfig(ENUMS.PRODUCER, functionalityMapped.toUpperCase(), actionMapped.toUpperCase()))
324+ // }
325325
326326exports . transformGeneralTopicName = transformGeneralTopicName
327327exports . getKafkaConfig = getKafkaConfig
328328exports . updateMessageProtocolMetadata = updateMessageProtocolMetadata
329329exports . createPrepareErrorStatus = createPrepareErrorStatus
330330exports . createState = createState
331- exports . produceGeneralMessage = produceGeneralMessage
331+ // exports.produceGeneralMessage = produceGeneralMessage
332332exports . ENUMS = ENUMS
333+ // exports.createGeneralTopicConf = createGeneralTopicConf
0 commit comments