Skip to content
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

Live Query: Not receiving Events on iOS Client. Our Parse server hosted on Azure App Services. #5272

Closed
bluelabeldeveloper1 opened this issue Jan 1, 2019 · 3 comments

Comments

@bluelabeldeveloper1
Copy link

bluelabeldeveloper1 commented Jan 1, 2019

Issue Description

We have hosted Parse server on Azure App Services. We are able to connect to live Query and able to Subscribe to it. We are getting below messages.

2019-01-01 19:03:26.917094+0530 LiveQueryTest[59625:972922] ParseLiveQuery: Sending message: {"clientKey":"xxxxxx","op":"connect","sessionToken":"","applicationId":"xxxxxx"}
2019-01-01 19:03:27.285251+0530 LiveQueryTest[59625:972922] ParseLiveQuery: Received message: {"op":"connected","clientId":5}
2019-01-01 19:03:27.388337+0530 LiveQueryTest[59625:972922] ParseLiveQuery: Sending message: {"query":{"className":"PostQuestionMessage","where":{"type":2}},"requestId":1,"op":"subscribe"}
2019-01-01 19:03:27.600455+0530 LiveQueryTest[59625:972813] ParseLiveQuery: Received message: {"op":"subscribed","clientId":5,"requestId":1}

And we are subscribed to Update Event but when we updated any records we are not getting event Back.

On the server:

We tried to listen to Specific port "1337" as below: Every time we do that our Parse Dashboard and API stops working. So Is it necessary to listen to specific port i.e "1337" or var port = process.env.PORT || 1337; will also work for Live Query.

var httpServer = require('http').createServer(app);
var port = 1337;
httpServer.listen(port, function() {
console.log('Parse Server running at ${port}');
console.log("The value of port is " + port); 
});
ParseServer.createLiveQueryServer(httpServer);

Expected Results

We should get the event update as per our subscription.

Actual Outcome

Not receiving event updates as per the Query Subscribed,

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : [2.3.8]
    • Operating System: [Linux]
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): [Remote Server - Azure]
  • Database

    • MongoDB version: [3.4]
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): [Remote Server - Azure]

Logs/Trace

Server:

info�: Parse LiveQuery Server starts running
info�: Create new client: 1
@Samigos
Copy link

Samigos commented Jan 8, 2019

So Is it necessary to listen to specific port i.e "1337" or var port = process.env.PORT || 1337; will also work for Live Query

No, it's not necessary! You can specify whatever port you like! You have to make sure though that Azure knows what ports need to be open for inbound traffic... (parse-server's default ports are 1337 parse & 4040 dashboard) Azure may disable all open ports by default for security reasons.

In case you're hosting your db in a separate machine, you need to declare mongo's port (27017) as outbound from parse-server and inbound from mongo-server.

Now if you still have problems, you should show your whole index.js to allow us be more helpful!

@flovilmart
Copy link
Contributor

@bluelabeldeveloper1 can you provide the configuration part for liveQuery? Did you configure the class names you want to listen to accordingly?

@stale
Copy link

stale bot commented Feb 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants