Giter Site home page Giter Site logo

fwsp-hydra examples about hydra HOT 6 CLOSED

pnxtech avatar pnxtech commented on May 21, 2024
fwsp-hydra examples

from hydra.

Comments (6)

cjus avatar cjus commented on May 21, 2024 1

@linde12 I'm working on a post for RisingStack which will focus on hydra messaging using sendMessage and related functions. The article should be published around the end of this month. We'll let you know when that's available.

from hydra.

aviyacohen avatar aviyacohen commented on May 21, 2024 1

I am transfering this post to a new issue since I see the title of the issue and the actual substance are not the same.

from hydra.

emadum avatar emadum commented on May 21, 2024

Hi @linde12. I agree that a simple example project would be very helpful, and we'll be putting out some practical examples soon. In the meantime, I'd recommend checking out @cjus's tutorial if that isn't what brought you here.

You can definitely do some sort of RPC communication between services using sendMessage and sendReplyMessage - it's what we've been doing. Since all messages need to be JSON, I think it would be quite possible to use something like JSON RPC in the payload (body field) of the UMFMessages, but we haven't needed to implemented anything this robust so far.

IMO, you shouldn't feel that all HydraExpress services are public APIs. You can limit their accessibility at the application-level with auth, or at the system-level with firewall rules. We're doing both, and have plans to make our Hydra Express auth service open source eventually. This service uses JSON Web Tokens, and is just a light wrapper around fwsp-jwt-auth that checks passwords against our user database, and injects relevant user-data into the issued JWT.

However, an HTTP API is sometimes overkill, and there may be no reason to introduce the overhead of HTTP communication when you can use Redis pub-sub messaging. This is particularly true if these APIs are exclusively being consumed by other Hydra services.

HTH!

from hydra.

linde12 avatar linde12 commented on May 21, 2024

@emadum Ah, yes i read that article. It was great and was what got me started. I see, but it's nothing that's built-in? To clarify what i want to do is something like this:

..., (req, res) => {
  hydra.sendMessage({to: 'service', from: 'another_service', bdy: {msg: 'Hello'}}, function onResponse (response) {
    res.send(response.bdy);
  });
});

@cjus That would be great, it's an important topic so some clarification would be great.

Again, great looking project. Can't wait to get started! 👍

from hydra.

cjus avatar cjus commented on May 21, 2024

@linde12 here you basically need to use Hydra's hydra.on('message', function(message) {}) and hydra.sendMessage call. There's nothing yet to do this automatically. Join us on our [email protected] account to discuss this further with the team. Send me an email to [email protected] and I'll send you an invite.

from hydra.

linde12 avatar linde12 commented on May 21, 2024

@cjus Ah, i see! Sent you an email and closing this for now! Thanks!

from hydra.

Related Issues (20)

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.