@@ -39,7 +39,6 @@ import (
3939type EventClientConfig struct {
4040 DestinationURL string `env:"EVENT_URL" envDefault:"http://localhost:3000/notify" description:"Notifier service url"`
4141 NotificationMedium NotificationMedium `env:"NOTIFICATION_MEDIUM" envDefault:"rest" description:"notification medium"`
42- EnableNotifierV2 bool `env:"ENABLE_NOTIFIER_V2" envDefault:"false" description:"enable notifier v2"`
4342}
4443type NotificationMedium string
4544
@@ -243,7 +242,7 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) {
243242 impl .logger .Debugw ("event before send" , "event" , event )
244243
245244 // Step 1: Create payload and destination URL based on config
246- bodyBytes , destinationUrl , err := impl .createPayloadAndDestination (event )
245+ bodyBytes , destinationUrl , err := impl .createV2PayloadAndDestination (event )
247246 if err != nil {
248247 return false , err
249248 }
@@ -252,13 +251,6 @@ func (impl *EventRESTClientImpl) sendEvent(event Event) (bool, error) {
252251 return impl .deliverEvent (bodyBytes , destinationUrl )
253252}
254253
255- func (impl * EventRESTClientImpl ) createPayloadAndDestination (event Event ) ([]byte , string , error ) {
256- if impl .config .EnableNotifierV2 {
257- return impl .createV2PayloadAndDestination (event )
258- }
259- return impl .createDefaultPayloadAndDestination (event )
260- }
261-
262254func (impl * EventRESTClientImpl ) createV2PayloadAndDestination (event Event ) ([]byte , string , error ) {
263255 destinationUrl := impl .config .DestinationURL + "/v2"
264256
@@ -302,15 +294,6 @@ func (impl *EventRESTClientImpl) createV2PayloadAndDestination(event Event) ([]b
302294 return bodyBytes , destinationUrl , nil
303295}
304296
305- func (impl * EventRESTClientImpl ) createDefaultPayloadAndDestination (event Event ) ([]byte , string , error ) {
306- bodyBytes , err := json .Marshal (event )
307- if err != nil {
308- impl .logger .Errorw ("error while marshaling event request" , "err" , err )
309- return nil , "" , err
310- }
311- return bodyBytes , impl .config .DestinationURL , nil
312- }
313-
314297func (impl * EventRESTClientImpl ) processNotificationSettings (notificationSettings []repository.NotificationSettings ) ([]* repository.NotificationSettingsBean , error ) {
315298 notificationSettingsBean := make ([]* repository.NotificationSettingsBean , 0 )
316299 for _ , item := range notificationSettings {
0 commit comments