2

I have a very simple component:

PushTopicTest.cmp
<aura:component implements="flexipage:availableForAllPageTypes" access="global">
    <lightning:empApi aura:id="empApi"/>
    <aura:handler name="init" value="{!this}" action="{!c.onInit}"/>
</aura:component>



PushTopicTestController.js
({
    onInit: function(component, event, helper) {
        var empApi = component.find("empApi");
        empApi.setDebugFlag(true);
        empApi.subscribe("/topic/AccountChanges?Id=0011t0000033C9QAAU", -1, function(message) {
            console.log("Event Received : " + JSON.stringify(message));
        });
    }
})

I also have PushTopic created like this: PushTopic Screenshot

What I am trying to do, is to only receive events for specific record Id. Based on documentation this should work: "/topic/AccountChanges?Id=0011t0000033C9QAAU", but it doesn't.

"/topic/AccountChanges" works though.

I've tried Id='0011t0000033C9QAAU' aswell, but no luck.

Do you know if it is possible at all?

  • 2
    The filtered subscription doesn't even seem to be working when subscribed from say a java client using emp connector. The connection itself fails if filtered subscription is provided as an argument to the emp connector client – Jayant Das Nov 5 '18 at 18:42
1

Filtering is not available for subscriptions to Change Data Capture event streams. Only PushTopic streams exposed the ability for filtered subscriptions https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_filtered_subscriptions.htm. We are prioritizing this work, but there the effort will require a few releases for GA.

Change Data Capture events : /data/*
PushTopic Streaming : /topic/*
Platform Events : /event/*
Generic Streaming : /u/*

0

Jayant - Sorry you encountered this error. I confirmed that this is indeed a recent issue with subscription filtering in EMP Connector and the empApi component. Salesforce is working on a fix. We have a PR for EMP Connector that fixes this problem here: https://github.com/forcedotcom/EMP-Connector/pull/43/files

  • Thanks for the update. I will definitely check it out after it is fixed. – diff Nov 13 '18 at 13:35
  • @Katia - Do you know if this has been resolved? Seems this was encountered again, here's the reference – Jayant Das Mar 20 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.