function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Streaming API not running



I have developed a VF for Streaming API which is working fine in developer edition. When I am running same code in another developer edition it is not running. I think there is some setting missing. Please help me.


<apex:page >
    <apex:includeScript value="{!$Resource.cometd}"/>
    <apex:includeScript value="{!$Resource.jquery1}"/>
    <apex:includeScript value="{!$Resource.json2}"/>
    <apex:includeScript value="{!$Resource.jquery_cometd}"/>
    <script type="text/javascript">
            $(document).ready(function() {
                // Connect to the CometD endpoint
                url: window.location.protocol+'//'+window.location.hostname+'/cometd/24.0/',
                requestHeaders: { Authorization: 'OAuth {!$Api.Session_ID}'}
                // Subscribe to a topic. JSON-encoded update will be returned
                // in the callback
                $.cometd.subscribe('/topic/Push', function(message) {
                $('#content').append('<p>Notification: ' +
                'Channel: ' + JSON.stringify( + '<br>' +
                'Record name: ' + JSON.stringify( +
                '<br>' + 'ID: ' + JSON.stringify( +
                '<br>' + 'Event type: ' + JSON.stringify(
                '<br>' + 'Created: ' + JSON.stringify(

        <div id="content">
            <h1>Streaming API Test Page</h1>
            <p>This is a demonstration page for Streaming API. Notifications from the
            InvoiceStatementUpdates channel will appear here...</p>





Did you create hte PushTopics in the second org too?


Yes I created. 


Here is my code to create push topic.


PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'Push';
pushTopic.Query = 'Select id, name from Account';
pushTopic.ApiVersion = 29.0;
pushTopic.NotifyForOperationCreate = true;
pushTopic.NotifyForOperationUpdate = true;
pushTopic.NotifyForOperationUndelete = true;
pushTopic.NotifyForOperationDelete = true;
pushTopic.NotifyForFields = 'Referenced';
insert pushTopic;


Once created, can you bring up SOQLExplorer and see this PT "object"

Hi Boman,


I am able to see notification in workbench but not in Salesforce.  I am not able to run following command

                url: window.location.protocol+'//'+window.location.hostname+'/cometd/24.0/',
                requestHeaders: { Authorization: 'OAuth {!$Api.Session_ID}'}

I think I am hitting any ouath or api limitation.