Skip to content

Latest commit

 

History

History
53 lines (41 loc) · 4.29 KB

README.md

File metadata and controls

53 lines (41 loc) · 4.29 KB

pub-sub-playground

A browser tool that lets you experiment with Publish Subscribe messaging in a 2d-physics/3d-rendered environment. It currently supports Solace (SMF) messaging (MQTT coming soon)

NOTE

Note that I have been alerted to a bug where when you change the name of the broker, all the portals that are already connected to that broker are confused. You need to click on each of those portals and simply hit Ok on their configuration. I will try to fix this asap, but in the meantime use this as a workaround.

Get Started from Source

git clone https://github.com/efunneko/pub-sub-playground.git
cd pub-sub-playground/
npm install
npm run watch

Then look at the console output for the URL to connect to - probably http://localhost:8080

Use the hosted version

Pub-Sub Playground

Things to know

  1. You need to create a 'broker' object to configure where and how to log in to the pub-sub broker
  2. Once you have a broker object, you can create a 'portal' object and configure it to choose which broker to use. This allows you to only have to configure all the broker related stuff in one place, even though you might have many portals
  3. Each portal will have an independent connection to the broker
  4. Each portal has an 'id' that is used in its default subscription so that objects going in a portal will come out of all other portals with the same id
  5. If a portal successfully connects to a broker, it will light up and it will be black in the middle of the ring. Otherwise it is gray. You can click on it to see the last error that it experienced.
  6. Currently, only balls or blocks can go through a portal. Blocks and balls can be configured to have a specific topic or they can be given a topic by the portal. If they have a 'forced' topic, then they will only come out of portals that have matching subscriptions or are bound to queues that have matching subscriptions
  7. There is some protection to avoid very fast 'ping-ponging' of objects through portals, where an object is not eligible to go through the portal it arrived on for the first 200ms.
  8. Anywhere you see a 'screwhead', you can grab it to resize or rotate the object it is attached to. This could use some polishing
  9. When changing barriers, you can grab internal screws and move them around. To extend a barrier, hold the CTRL key down when moving the a screw at the end of the barrier and it will add a screw. If you drag a screw on top of a neighboring screw, it will merge them into a single screw.
  10. When dragging an object, if you hold the CTRL key, it will clone it.
  11. Balls can be annotated with a 'label'. There is a basic expression language for this. The most important expression is ${seqNum(<sequence-name>, [start], [step])} which can give you an increasing sequence on the balls. You would configure this on the Emitter so that each ball emitted would get a unique number.
  12. Topics given to objects can use this same expression language to uniquify topics. For example, you can have a topic like: demo/ball/${attr(color) and it will put the ball's color as the last level of its published topic.
  13. When you click the save button the config will be in your URL so you can bookmark it or share it with others
  14. You can pause the simulation by hitting the Pause button in the top left corner. Then you can use the 'hamburger' menu to create new sessions, open old ones, delete the current one and import/export the sessions. You can add new objects using the + (plus) button.
  15. You can delete selected objects by clicking on the red trashcan button in the bottom right corner
  16. You can undo with CTRL-Z

ToDo List (incomplete)

  1. Enable MQTT messaging
  2. Fix Blocks - currently balls are the only moving objects that work properly
  3. Fix the object Add menu to look much better
  4. Add a 'function' object that can do things when hit by a ball. For example, delete the ball that hit it and create a new one of a different color and topic - this simulates a micro-service issuing a reply
  5. Add the abiltity to zoom the view with CTRL-scrollwheel
  6. Add mobile stuff: dynamic gravity, orientation adjustment
  7. Better interface for broker configuration
  8. Pop-up on load to allow for broker adjustments so that you don't accidentally use someone else's broker
  9. Fix subscription management