nestjs-geteventstore icon indicating copy to clipboard operation
nestjs-geteventstore copied to clipboard

invalid event exception

Open kodeine opened this issue 4 years ago • 2 comments

image any idea's why this is happening? i have included the context module in app module.

kodeine avatar Nov 17 '21 00:11 kodeine

duplicate of #70

i used

export const eventBusConfig = (allowedEvents): EventBusConfigType => ({
  read: {
    allowedEvents,
  },
  write: {
    serviceName: process.env.APP_NAME,
    validate: null,
    prepare: null,
  },
});

but i still get the same validation error.

kodeine avatar Nov 17 '21 01:11 kodeine

Okay so the problem is in the readme and interface.

export const eventBusConfig = (allowedEvents): EventBusConfigType => ({
  read: {
    allowedEvents,
  },
  write: {
    serviceName: process.env.APP_NAME,
    validate: false, ----> wrong here
    prepare: false, ----> wrong here
  },
 validate: false, ---> works
 prepare: false ---> works
});

Secondly, setting validate to true, i was getting error that corelation-id is missing. But after setting to false, it bypasses validation, but in the event itself i see in metadata,

image

correlation_id is present! so if it could generate why it didn't before when the value to validate was true?

kodeine avatar Nov 21 '21 01:11 kodeine