You need to sign in to do that
Don't have an account?
mariappangomathiraj
Appending message type to URI /cometd/24.0/ is not supported, disabling 'appendMessageTypeToURL' configuration
How to resolve this issue when using streaming API ?
My page code example:
<apex:page id="PG" controller="StreamingAPIController1"> <apex:form id="FRM"> <apex:includeScript value="{!$Resource.Comedy1}"/> <apex:includeScript value="{!$Resource.Jquery}"/> <apex:includeScript value="{!$Resource.Json2}"/> <apex:includeScript value="{!$Resource.jquery_cometd}"/> <apex:actionFunction name="GetRefreshedAccounts" reRender="PB,PBT"/> <script type="text/javascript"> (function($) { $(document).ready(function() { // Connect to the CometD endpoint $.cometd.init({ 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 // In this example we are using this only to track the generated event $.cometd.subscribe('/topic/RefreshAccounts', function(message) { //You can use message as it will return you many attributes //I am just using to track that event is generated GetRefreshedAccounts(); }); }); })(jQuery) </script> <apex:pageBlock id="PB"> <apex:variable var="count" value="{!0}" /> <apex:pageBlockTable id="PBT" value="{!getRefreshedAccount}" var="AllAcc"> <apex:column headerValue="S.No."> <apex:variable var="count" value="{!count+1}" /> {!count} </apex:column> <apex:column value="{!AllAcc.Name}" headerValue="Name"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
My controller Code:
public class StreamingAPIController1
{
//Everytime page is reRendered it will get refreshed values of account
public List<Account> getRefreshedAccount
{
get
{
return [select Id, Name from Account LIMIT 50000] ;
}
set;
}
public StreamingAPIController1()
{
}
}
Push topic code:
PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'RefreshAccounts';
pushTopic.Query = 'SELECT Id, Name FROM Account';
pushTopic.ApiVersion = 33.0;
pushTopic.NotifyForFields = 'All';
insert pushTopic;
Please help to resolve this issue.. I have created Account record,but it haven't replicated in Streaming page.
My page code example:
<apex:page id="PG" controller="StreamingAPIController1"> <apex:form id="FRM"> <apex:includeScript value="{!$Resource.Comedy1}"/> <apex:includeScript value="{!$Resource.Jquery}"/> <apex:includeScript value="{!$Resource.Json2}"/> <apex:includeScript value="{!$Resource.jquery_cometd}"/> <apex:actionFunction name="GetRefreshedAccounts" reRender="PB,PBT"/> <script type="text/javascript"> (function($) { $(document).ready(function() { // Connect to the CometD endpoint $.cometd.init({ 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 // In this example we are using this only to track the generated event $.cometd.subscribe('/topic/RefreshAccounts', function(message) { //You can use message as it will return you many attributes //I am just using to track that event is generated GetRefreshedAccounts(); }); }); })(jQuery) </script> <apex:pageBlock id="PB"> <apex:variable var="count" value="{!0}" /> <apex:pageBlockTable id="PBT" value="{!getRefreshedAccount}" var="AllAcc"> <apex:column headerValue="S.No."> <apex:variable var="count" value="{!count+1}" /> {!count} </apex:column> <apex:column value="{!AllAcc.Name}" headerValue="Name"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
My controller Code:
public class StreamingAPIController1
{
//Everytime page is reRendered it will get refreshed values of account
public List<Account> getRefreshedAccount
{
get
{
return [select Id, Name from Account LIMIT 50000] ;
}
set;
}
public StreamingAPIController1()
{
}
}
Push topic code:
PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'RefreshAccounts';
pushTopic.Query = 'SELECT Id, Name FROM Account';
pushTopic.ApiVersion = 33.0;
pushTopic.NotifyForFields = 'All';
insert pushTopic;
Please help to resolve this issue.. I have created Account record,but it haven't replicated in Streaming page.