messaging.rst 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Lakesuperior Messaging
  2. ======================
  3. Lakesuperior implements a messaging system based on ActivityStreams, as
  4. indicated by the `Fedora API
  5. specs <https://fedora.info/2017/06/30/spec/#notifications>`__. The
  6. metadata set provided is currently quite minimal but can be easily
  7. enriched by extending the
  8. :class:`~lakesuperior.messaging.messenger.Messenger` class.
  9. STOMP is the only supported protocol at the moment. More protocols may
  10. be made available at a later time.
  11. Lakesuperior can send messages to any number of destinations: see
  12. :doc:`setup`.
  13. By default, `CoilMQ <https://github.com/hozn/coilmq>`__ is provided for testing
  14. purposes and listens to ``localhost:61613``. The default route sends messages
  15. to ``/topic/fcrepo``.
  16. A small command-line utility, also provided with the Python
  17. dependencies, allows to watch incoming messages. To monitor messages,
  18. enter the following *after activating your virtualenv*:
  19. ::
  20. stomp -H localhost -P 61613 -L /topic/fcrepo
  21. See the `stomp.py library reference
  22. page <https://github.com/jasonrbriggs/stomp.py/wiki/Command-Line-Access>`__
  23. for details.
  24. Disabing messaging
  25. ------------------
  26. Messaging is enabled by default in Lakesuperior. If you are not interested in
  27. interacting with an integration framework, you can save yourself some I/O and
  28. complexity and turn messaging off completely. In order to do that, set all
  29. entries in the ``routes`` section of ``application.yml`` to not active, e.g.::
  30. [...]
  31. messaging:
  32. routes:
  33. - handler: StompHandler
  34. active: False # ← Disable the route
  35. protocol: '11'
  36. host: 127.0.0.1
  37. port: 61613
  38. username:
  39. password:
  40. destination: '/topic/fcrepo'
  41. formatter: ASResourceFormatter
  42. A message queue does not need to be running in order for Lakesuperior to
  43. operate, even if one or more routes are active. In that case, the application
  44. will throw a few ugly mssages and move on. *TODO: This should be handled more
  45. gracefully.*