Giter VIP home page Giter VIP logo

vertx-bus-bower's Introduction

SockJS Event Bus bridge for Vert.x 3

The vertx-eventbus.js file is a SockJS-based event bus bridge to connect your JavaScript frontend application to Vert .x 3.x. You can use it in a front-end application or in a node.js application.

If you already use a previous version of the bridge, please check the changelog below.

Changelog

Changes from the 3.2 to 3.2.1

  • Update the eventbus client version to 3.2.1

Changes from the 3.1.1 to 3.2

  • Update the eventbus client version to 3.2.0

Changes from the 3.1 to 3.1.1

  • Update the main attribute in the bower.json file.

Changes from the 3.0.x to 3.1

  • IMPORTANT: The API has been changed to be compatible with node.js and to be closer to the vert.x eventbus API .Creating the bridge is made using var eb = new EventBus("http://localhost:8080/eventbus"); instead of new vertx .EventBus.... In addition, registering a handler use the node convention: eb.registerHandler("metrics", function(err, res) {...} instead of ev.registerHandler("metrics", res).
  • The file name has been updated to eventbus-client.js

Build

This project is exotic... It generate a git repository compliant with the Bower expectation. It:

  1. Compute the bower.json content and copy it to the root directory
  2. Download the vert.x event bus bridge and copy it to the root directory

Generation is triggered by mvn clean package

Updating

    1. Open the pom.xml file and edit the vertx.version property (~ project version) and the package.version (packaging iteration)
    1. Update using mvn clean package
    1. Add all modified files:

NOTE: the $VERSION is the package.version

git add bower.json vertx-eventbus.js pom.xml README.md
    1. Commit
git commit -m "update version to $VERSION"

    1. Create tag
git tag -a $VERSION -m "tag for version $VERSION"
    1. Push everything
git push origin --tags master

Done.

As the repository is already registered on Bower, the update should be automatic.

vertx-bus-bower's People

Contributors

cescoffier avatar pmlopes avatar tsegismont avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vertx-bus-bower's Issues

eventBus.send() does not go to the server after second browser connects

Hi,

I'm having great difficulties with the eventbus. I found out that an eventBus.send() always goes to the last-connected browser, but NOT to the server! Help. I really need to be able to communicate with the server, no matter how many other browsers have connected or how what messages were sent before.

Server code:
https://github.com/nielsbaloe/vertx-ui/blob/master/master/src/main/java/live/connector/vertxui/server/samples/chatEventBus/ExampleChatEventbus.java

Client code:
https://github.com/nielsbaloe/vertx-ui/blob/master/master/src/main/java/live/connector/vertxui/client/samples/chatEventBus/Client.java

You can download the project, run ExampleChatEventBus and open a browser twice pointed at http://localhost (enter a name twice). You will see "I want a reply" appearing in the browser instead of the server.

Much thanks fixing, I'm building a whole java+javascript ecosystem around the eventbus but this isn't helping. Thanks!
Niels

Unregister handler with lamdba function as callback

Hi ,

To unregister an handler, we have to pass to callback function used during the register.

However when using typescript , i use lambda function :

...
 this.eventBus.registerHandler('/' + projectId
        + '.' + faulttreeId + '/' + 'diag', {} ,(err, resp)=>{
                            console.log(resp);
                            this.handleServerResponse(child.data.uuid,resp);
                        });

However it is impossible to unregister this handler ...

This is due to this var idx = handlers.indexOf(callback); which return -1.

Request for version patches reflecting updates on the master branch

The current bower version is "3.0.0" and waiting for the release of "3.1.0" slows down my development process because other components make use of this bower component.

Generally spoken: Who wants to develop with code which is 4 weeks old?

I whish that this bower component gets patched for every change of the master file https://github.com/vert-x3/vertx-web/blob/master/src/client/vertxbus.js.

This could be done by adding a path-version in the following way during the ongoing version "3.1.0-SNAPHOT":
"3.1.0-SNAPHOT.1","3.1.0-SNAPHOT.2","3.1.0-SNAPHOT.3", etc.

http://semver.org/

Messages are anonymous: there is no sender or other identification in a message

Hi,

At the serverside, I have another big problem. There is no way to tell who has sended the message. Using pure websockets or sockjs at least I have the socket .writeHandlerID()/textHandlerID(), but using the eventbus there is no way to tell who's sending.

The message.replyAddress() is something special for that send/receive only, so that isn't helping.
I suggest to introduce a message.senderID() which matches the writeHandlerID/textHandlerID.

Thanks for any help! Without any help, it's not really possible to use the vertx-eventbus in a usefull way I'm afraid...

Niels

Something forgotten.

Hi,
I think there is something forgotten after the migration to the version 3, take a look the line 278 on the javascript.

  EventBus.prototype.close = function () {
    this.state = vertx.EventBus.CLOSING;  // <------------------------------------
    this.sockJSConn.close();
  };

that line should be this.state = EventBus.CLOSING, without the prefix vertx., right?

close is not defined

Hello,

can someone fix this Line in the bower and NPM Package ?

/**
 * Closes the connection to the EvenBus Bridge.
 */
EventBus.prototype.close = function () {
  this.state = vertx.EventBus.CLOSING;
  this.sockJSConn.close();
};

vertx is not defined -> should be:

this.state = EventBus.CLOSING;

Thanks

vertx3-eventbus-client this.sockJSConn.onClose does not pass the Close event along to the implementing function.

The this.sockJSConn.onClose function specified here:

https://github.com/vert-x3/vertx-bus-bower/blob/master/vertx-eventbus.js#L106

Should pass the https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent along with the self.onclose() function below it like so:

   this.sockJSConn.onclose = function (closeEvent) {
      self.state = EventBus.CLOSED;
      if (pingTimerID) clearInterval(pingTimerID);
      self.onclose && self.onclose(closeEvent);
    };

This way any implementing calls can handle specific CloseEvent.Codes accordingly

Questions about 3.5.0

There seems to be a lot of changes in 3.5.0 when showing the diff 32065d5

1 .Are they affecting the API of the client side using vertx-eventbus.js?
2. Where is a changelog to 3.5.0?

vertxbus.js onmessage should accept false.

Within sockJSConn.onmessage, there is a conditional that is
if (body) {
handler(body, replyHandler);
}
it should be changed to this so that it can accept false replies or messages. Or however you change it just that it should accept false.
if (body !== undefined && body !== null) {
handler(body, replyHandler);
}

SockJS version and CDN and documentation

Hi,

Some minor issues:

  • reading the sourcecode I could find out how to use the vertx-eventbus.js . Please provide documentation which a description of all input- and output parameters for all methods. Or: I couldn't find it, where is it?

  • The Vert.X docs for vertx-eventbus still use sockJS 0.3.4 at http://vertx.io/docs/vertx-web/java/#_sockjs . Maybe you want to update and verify whether it's all good and sound with the current SockJS 1.1.1 .

  • Why is the vertx-eventbus.js not available through any CDN? Not yet taken care of perhaps? I don't want to serve it myself from my own server to browsers - just like I don't provide jquery libraries and such. So where is the CDN? Can I help providing it?

Thanks,
Niels

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.