NotificationAppComponent

Required to implement a notification component. Notification components is invoked whenever a notification is send from the dexi system. This enables sending notification to any number of channels like slack, text message etc.

Source: Github

Example:

package my.org.components;

import io.dexi.service.AppContext;
import io.dexi.service.components.AppComponent;
import io.dexi.service.components.NotificationAppComponent;

@AppComponent("send-notification-to-my-app")
public class MyNotificationAppComponent implements NotificationAppComponent<MyAppConfig, MyComponentConfig> {

    @Override
    public Class<MyComponentConfig> getComponentConfigClass() {
        return MyComponentConfig.class;
    }

    @Override
    public void invoke(AppContext<MyAppConfig, MyComponentConfig> ctxt, NotificationAppComponent.Notification notification) {
        //Perform some action with notification
    }
}
components:
- name: send-notification-to-my-app
  type: notification
  title: Send notification to my app
  specification:
    endpoint: # Will invoke MyNotificationAppComponent::invoke
      url: "${baseUrl}/dexi/notification/invoke"
      method: POST