Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message filtering #90

Open
Chumper opened this issue Nov 30, 2014 · 6 comments
Open

Message filtering #90

Chumper opened this issue Nov 30, 2014 · 6 comments
Milestone

Comments

@Chumper
Copy link

Chumper commented Nov 30, 2014

I read about the message filter, but the wiki just lists some headers.
How about continuing the work there?

@bennidi
Copy link
Owner

bennidi commented Dec 2, 2014

Yes, I think that is a good idea. I want to redesign the structure of the entire wiki because I think it is not very well organized. But I just can't find the time to do so. Other open source projects also require time and attention.

Do you have a specific question about message filtering?

@Chumper
Copy link
Author

Chumper commented Dec 2, 2014

It was just a quick shot but i wanted to make the bus kind of bi-directional.

To do that i would require some kind of message id in the message and need to watch on incoming messages for this id to detect a response, kind of a custom topic or queue for the response.

For that i would need the filters but as i havent found any documentation in the wiki and was too lazy to look into some code i dont know if that would work with the bus.

If i could dynamically create topics bi directional would be no problem as i can create a custom random id topic for the message where another handler could answer. Since all bus implementation rely on reflections and custom annotation handlers, i need to solve this with some kind of message id

@bennidi
Copy link
Owner

bennidi commented Feb 22, 2015

Hi, sorry for not getting back to you. It seems I somehow forgot about this issue. Are you still interested? I have the intuition the your requirement can be implemented quite easily with the functionality that is already there. If you are interested you can lay out your use case in more detail and I will see what I can do.

@Chumper
Copy link
Author

Chumper commented Feb 23, 2015

Yes, even so i now use Spring Reactor i will lay out a use case for you so you can decide if the use case is common or not :) give me a few hours until i get home

@message
Copy link

message commented May 6, 2015

@Chumper hope you're home and safe

@Chumper
Copy link
Author

Chumper commented May 16, 2015

Yes, took me quite a while to get home but i will try to present you my current use case:

Currently i am writing an app with libgdx, it is a puzzle game.
In the game i use the messages to send events of actions i took in the code, e.g. PuzzleCreated, PuzzleSolved, PuzzleRated and so on.
In most cases this is working perfectly but in specific cases i need to react on the action.

For example after a puzzle is rated i want to transmit the rating to the server that can happen without waiting for a response.

Another use case is puzzle generation: A user can generate a puzzle on the device. After the user presses Generate i send an GeneratePuzzleIntent and will show a loading indicator on the screen. At this point i am waiting for a PuzzleGenerated event to show the generated puzzle on the screen.

In order for this to work, i need to listen on dynamic topics or wait until a message returns to the sender which is not possible at the moment.

Therefore i would appreciate a consumer i can pass to the bus which is executed after all consumers handled the message or the possibility to create a second dynamic topic where all handlers can respond to.

I used reactor http://projectreactor.io/docs/reference/#bus-request-reply in another project and i needed the request response pattern 1-2 times.
It would be great if MBassador could offer something similar even with some kind of more code effort.

@bennidi bennidi added this to the 1.3.0 milestone Jun 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants