-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fatal Error When Running project #83
Comments
Can you check your default ini settings for what your
`default_socket_timeout` is. Chances are this value is causing the problem.
…On Thu, Nov 26, 2020 at 9:26 PM KhinLaPyaeWon ***@***.***> wrote:
Here is my code. when I start $client->strat();, the page loads and after
a few times later, occurs fatal error.
public function streamLogin()
{
$client = new BayeuxClient(
new LongPollingTransport(),
new OAuthProvider(
Configure::read('clientId'),
Configure::read('clientServer'),
Configure::read('targetURL'),
Configure::read('userName'),
Configure::read('password').Configure::read('securityToken')
),
null,
'50.0'
);
// Getting a channel tells the client you want to subscribe to a topic
$channel = $client->getChannel('/topic/TestPushTopic');
// Register topic consumers prior to starting the client
$channel->subscribe(
Consumer::create(
function (ChannelInterface $channel, Message $message) {
// This will be fired when the client receives a topic notification
$payload = $message->getData();
// The payload has information about the event that occurred
$event = $payload->getEvent();
var_dump($event->getType()); // "created", "updated", "undeleted", "deleted"
var_dump($event->getCreatedDate()->format(\DATE_ISO8601)); // outputs the datetime the event was created
var_dump($event->getReplayId()); // This ia n ID used by the replay extension so it can pick up the feed where it left off
$sobject = $payload->getSobject();
var_dump($sobject->Id); // Get the Id
var_dump($sobject->getFields()); // this outputs all the fields and their values that were in the create or update request
})
);
// Start the client to begin receiving notifications;
$client->start();
[image: image]
<https://user-images.githubusercontent.com/73816835/100403877-5b083880-30a3-11eb-9944-259ec65a8098.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#83>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6475XM2UOGW7OEURKV4VTSR4E5LANCNFSM4UELMTRQ>
.
|
@curiosity26 thanks for ur reply . I changed default socket timeout to -2 but still getting error.I set Durability to -2 so I think that I will get notification within 24 hours changes when the page was loading but it generated nothing and still page loading.As soon as I updated something on salesforce, the page occurs fatal error page(maximun timeout limit same as above) immidiately and stops.I checked the client handshake and subscribe are successfully but when started getting notification it was errors.. |
@curiosity26 When I exit() the code as like below,I found that client receives notification at first time. Can u guess which parts will be the problems. Kindly sir.... $channel->subscribe(
$client->start(); |
Is there any more information in the php lot about this error? I’m curious
to what the trace stack says leading up to the error. That will help
recreate the problem as well. Thanks.
…On Mon, Nov 30, 2020 at 11:35 PM KhinLaPyaeWon ***@***.***> wrote:
@curiosity26 <https://github.com/curiosity26> When I exit() the code as
like below,I found that client receives notification at first time. Can u
guess which parts will be the problems. Kindly sir....
$channel->subscribe(
Consumer::create(
function (ChannelInterface $channel, Message $message) {
$payload = $message->getData();
$event = $payload->getEvent();
var_dump('noti Type '.$event->getType());
var_dump('noti created date
'.$event->getCreatedDate()->format(\DATE_ISO8601));
var_dump('noti replay id '.$event->getReplayId());
$sobject = $payload->getSobject();
var_dump('noti sobject id '.$sobject->Id);
var_dump($sobject->getFields());
exit();
})
);
$client->start();
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#83 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6475RXXKMJ5NZTYVCH6OLSSRXBNANCNFSM4UELMTRQ>
.
|
No description provided.
The text was updated successfully, but these errors were encountered: