You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, all form submissions are published to a single global SNS topic configured via `SNS_ADAPTER_TOPIC_ARN`, however we can additionally route specific forms to their own SNS topics.
4
+
5
+
When a form is submitted, the runner always publishes to the global topic. If the submitted form's ID is present in the per-form topic map, the exact same payload is also published to the configured topic for that form.
6
+
7
+
## Configuration
8
+
9
+
Set the `SNS_FORM_TOPIC_ARN_MAP` environment variable to a JSON object that maps form IDs to SNS topic ARNs. Environment variables are managed in the [cdp-app-config](https://github.com/defra/cdp-app-config) repository.
- Form `abc123` publishes to the global topic and to `my-form-topic`
24
+
- Form `def456` publishes to the global topic and to `another-form-topic`
25
+
- All other forms publish to the global topic only
26
+
27
+
## Future direction
28
+
29
+
The longer-term intention is to move this configuration into Designer, allowing form authors to add additional outputs directly against a form without requiring an environment variable change. This approach was not implemented due to time constraints and a deadline. The environment variable solution described here is the interim approach until that work is prioritised.
30
+
31
+
## Notes
32
+
33
+
- The variable must be valid JSON. An invalid value will cause the application to fail on startup.
34
+
- The payload published to the form-specific topic is identical to the one sent to the global topic.
35
+
- If `SNS_FORM_TOPIC_ARN_MAP` is not set, all forms publish to the global topic only — there is no change in behaviour.
'Failed to publish form adapter event to form-specific topic - no message ID returned'
94
+
)
95
+
}
96
+
97
+
logger.info(
98
+
`Published form adapter event to form-specific topic for submission ${validatedPayload.meta.referenceNumber}. MessageId: ${formSpecificResult.MessageId}`
0 commit comments