Skip to content

Commit

Permalink
Merge origin/master
Browse files Browse the repository at this point in the history
  • Loading branch information
TareqK committed Oct 13, 2022
2 parents 95974a3 + 67e3cd8 commit 0b792c0
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions easybus-rabbitmq/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,37 @@ RabbitMQ connection.
bus.search("me.kisoft.easybus.rabbitmq.test");
```

Events can also be attached to specific queues, by using the ```@QueueName``` annotation
Events can also be attached to specific exchanges, by using the ```@ExchangeName``` annotation

```java
@Event
@QueueName("named_event")
@ExchangeName("exchange.name")
public class NamedEvent{
....
}
```

If no name is given, then the name of the event class itself will be used as the queue name.
If no name is given, then the name of the event class itself will be used as the exchange name.


Event Handlers can also be attached to specific queues, by using the ```@QueueName``` annotation

```java
@Handle(event=MyEvent.class)
@QueueName("queue.name")
public class MyEventHandler{
....
}
```

If no name is given, then the name of the handler class itself will be used as the queue name.

## Caveats

1. All messages go on the main exchange
2. Each Event has its own channel open, which might not be optimal in a larger application
1. ~~All messages go on the main exchange~~ As of 2.2.0, you can use custom exchanges
2. ~~Each Event has its own channel open, which might not be optimal in a larger application~~ This is generally best practice it seems
3. Object De/Serialization is done using Jackson, which might not be ideal, and right now,
there is no way to customize the ```ObjectMapper``` class.
4. You need Getters/Setters for everything you want to de/serialize
5. You cant rely on object references - this makes callbacks a little more difficult.
6. All Queues are destroyable(no persistent queues)
6. All Queues are destroyable(no persistent queues)

0 comments on commit 0b792c0

Please sign in to comment.