[Logo] Terracotta Discussion Forums (LEGACY READ-ONLY ARCHIVE)
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
[Expert]
Nirvana Messaing p2p API  XML
Forum Index -> General
Author Message
4ndrew

neo

Joined: 09/06/2013 06:06:19
Messages: 2
Offline

Recently I've tried to understand how to use P2P in Nirvana Messaging using JavaScript API but without success. First of all, JavaScript p2p example page displays nothing (I mean: http://um.terracotta.org/developers/nirvana/web/javascript/examples/?example=echoservice link from http://um.terracotta.org/developers/nirvana/web/javascript/p2p/). And seems nirvana.js doesn't contain any classes related to p2p services.

Could anyone help me with p2p JavaScript API documentation, please? Is p2p client API really supported in javascript?
tamfb

neo

Joined: 09/09/2013 04:03:02
Messages: 1
Offline

Hi 4ndrew,

The P2P APIs have not been exposed in the more recent versions of the JavaScript API, because the alternative delivery mechanisms of channels, queues and datagroups provide a simpler and more efficient means of achieving the old P2P functionality, without the need to familiarise oneself with additional API methods.

The original P2P functionality did not implement direct client-to-client communication; all communication using the P2P API took place via the server (i.e. client -> server -> serviceprocess -> server -> client).

With the current API, this is analogous to, for example, using a queue to hold client messages, and to have a second process consuming these messages and publishing appropriate responses to the client, either via another queue, or via a channel or a datagroup. An example of such a system can be found at:

  • Requester: http://um.terracotta.org/developers/nirvana/enterprise/java/examples/?example=Requester
  • Responder: http://um.terracotta.org/developers/nirvana/enterprise/java/examples/?example=Responder

    Using the old P2P API, the "serviceprocess" mentioned above was typically implemented using one of the enterprise APIs (e.g. Java), and would correspond to the "Responder" in the above example.

    The "Requester" in this particular example is also implemented in Java, but the same thing can easily be implemented as a JavaScript client that publishes and subscribes to queues in the same way.

    Apologies for the confusion caused by old documentation still existing on the current website; we will get this tidied up immediately!
  • 4ndrew

    neo

    Joined: 09/06/2013 06:06:19
    Messages: 2
    Offline

    Thank you! Seems Queue is exactly what I need!
     
    Forum Index -> General
    Go to:   
    Powered by JForum 2.1.7 © JForum Team