Event Notification Configurations¶
To enable the Event Notification feature in WSO2 Open Banking:
- To create Event Notification database tables:
- Go to the
<IS_HOME>/dbscripts/open-banking/event-notificationsdirectory. - According to your database, execute the relevant script against the
openbank_openbankingdbdatabase.
- Go to the
- Open the
<IS_HOME>/repository/conf/deployment.tomlfile. - Find the
resource.access_controlconfigurations and add the following tags to secure the Event Notification endpoints:[[resource.access_control]] context = "(.*)/api/openbanking/event-notifications/(.*)" secure="true" http_method="all" permissions=["/permission/admin"] allowed_auth_handlers = ["BasicAuthentication"] -
Add the following tags after
[open_banking]tag and configure them:Click here to see the definitions of the configuration tags...
Configuration Description token_issuerThe issuer of the notification JWT. For example, bank. number_of_sets_to_returnThe maximum number of events to be returned. This is the default value for maxEvents, if the request payload has not defined a value.event_creation_handlerConfigure the Event Creation Handler. If you have not implemented a custom handler, configure the default handler by following the sample below. This handler adheres to the IETF Security Event Token (SET) specification. event_polling_handlerConfigure the Event Polling Handler. If you have not implemented a custom handler, configure the default handler by following the sample below. This handler adheres to the IETF Security Event Token (SET) specification. event_subscription_handlerConfigure the Event Subscription Handler. If you have not implemented a custom handler, configure the default handler by following the sample below. This handler adheres to the IETF Security Event Token (SET) specification. event_notification_generatorConfigure the Event Notification Generator. If you have not implemented a custom generator, configure the default handler by following the sample below. This generator adheres to the IETF Security Event Token (SET) specification. set_sub_claim_included,set_txn_claim_included,set_toe_claim_includedConfigure the customized optional claims in event notification using these tags. They represent the subject, transaction, and time of event claims respectively. [open_banking.event.notifications] token_issuer = "www.wso2.com" number_of_sets_to_return = 5 event_creation_handler = "com.wso2.openbanking.accelerator.event.notifications.service.handler.DefaultEventCreationServiceHandler" event_polling_handler = "com.wso2.openbanking.accelerator.event.notifications.service.handler.DefaultEventPollingServiceHandler" event_subscription_handler = "com.wso2.openbanking.accelerator.event.notifications.service.handler.DefaultEventSubscriptionServiceHandler" event_notification_generator = "com.wso2.openbanking.accelerator.event.notifications.service.service.DefaultEventNotificationGenerator" set_sub_claim_included = true set_txn_claim_included = true set_toe_claim_included = true -
To enable Real Time Event Notification add the following tags and configure them:
Click here to see the definitions of the configuration tags...
Configuration Description enableTo enable the Real-time event notification feature. periodic_cron_expressionThe time period to trigger the real-time event notification consumer to consume notifications from the queue. request_timeoutTimeout for the HTTP client requests in seconds. maximum_retry_countThe maximum number of retries for the retry policy. initial_retry_waiting_timeWaiting time between the initial try and the first retry in seconds. retry_functionthis function decides the retry mechanism.
EX: exponential function (nextWaitingTime = 2 x previousWaitingTime)
LINEAR: linear function (nextWaitingTime = 2 x previousWaitingTime)
CONSTANT: waiting time is constant (initial_retry_waiting_time)
Any other function will return an errorcircuit_breaker_open_timeoutRetry mechanism will be terminated after passing this time from the initial HTTP request send time. Needs to provide this value in seconds. thread_pool_sizeThread pool size for the event notification consumer. event_notification_request_generatorClasspath of the real-time event notification request generator which is responsible for adding additional headers to the POST request and for preparing the notification payload. If you have not implemented a custom handler, configure the default handler by following the sample below. [open_banking.event.notifications.realtime] enable = true periodic_cron_expression = "0 0/1 0 ? * * *" request_timeout = 60 maximum_retry_count = 5 initial_retry_waiting_time = 5 retry_function = "EX" circuit_breaker_open_timeout = 60 thread_pool_size = 3 event_notification_request_generator = "com.wso2.openbanking.accelerator.event.notifications.service.realtime.service.DefaultRealtimeEventNotificationRequestGenerator"