Jaster
Jaster

Reputation: 37

Difference between register/subscribe call/publish

I'm learning WAMP (Web Application Messaging Protocol ). I'm trying to figure out the difference between these methods in AutobahnJS. ( and PHP Client with Thruway - https://github.com/voryx/Thruway)

But I can't get the difference between them, any tips?

Thanks :)

Upvotes: 1

Views: 1012

Answers (2)

Vladimir Vukanac
Vladimir Vukanac

Reputation: 984

Despite library you use, WAMP define:

Message

  1. For sending messages (can be objects also) without response to one or more clients use subscribe/publish.
    1. To form a group/room/communication pool/newspaper defined by topic, every client must first subscribe to that topic.
    2. To notice every listener of topic (subscribers), publisher publishes message. As result publisher only receives a callback publish Ok or publish failed.

Service

  1. For offering some "service" on one side, like providing math operation, or discover your current GPS location, and to use those services on the other side, use register/call remote procedure call (RPC). A service will return some response to caller only.
    1. Provider first must register service to allow clients to use it.
    2. To use service, client must make an RPC call, with or without parameters and it will receive results from the service.

Note: Service and Message are probably not totally correct terms here.

Upvotes: 2

oberstet
oberstet

Reputation: 22051

You might have a look at the "A quick introduction to WAMP" presentation on the WAMP homepage, the WAMP FAQ (here and here) or the figures in the section "How it works" on the Crossbar.io homepage.

Upvotes: 3

Related Questions