Does anyone know how to effectively filter EventBridge events so my Node.js middleware only processes conversation.end events for a specific queue? we’re currently getting flooded with events for every single queue in the org, which is spiking our lambda costs and processing time. i’ve set up a standard SQS subscription via EventBridge, and the raw event payload looks fine, but filtering on the source side seems tricky since the detail object structure varies a bit depending on the event type. here is a snippet of the event detail i’m seeing for a conversation end:
{
"conversationId": "abc-123",
"type": "conversation",
"event": "end",
"routingData": {
"queue": {
"id": "555-queue-id",
"name": "Support Tier 2"
}
}
}
i tried adding a filter policy on the SQS subscription in the Genesys Cloud admin console, but it doesn’t seem to expose the routingData.queue.id field directly in the filter UI options. i’m currently doing the filtering in the lambda handler like this:
const handler = async (event) => {
const targetQueueId = '555-queue-id';
for (const record of event.Records) {
const body = JSON.parse(record.body);
const detail = JSON.parse(body.Message);
// checking if the queue matches
if (detail.routingData?.queue?.id === targetQueueId && detail.event === 'end') {
await processConversationEnd(detail);
}
}
};
this works, but it feels inefficient to process and discard thousands of events just to find the ones we care about. is there a way to define this filter in the EventBridge rule itself before it hits SQS? or maybe a specific API call to update the subscription filter that includes the nested queue path? i’ve checked the /api/v2/analytics/events endpoints but that’s for historical data, not real-time subscription management. any pointers on how to tighten this up at the source would be great. i’m running out of ideas on how to reduce the noise without rewriting the whole ingestion pipeline.