Commands and events are messages, why use two different message mechanism as infrastructure

hi:
Commands and events are messages, why use two different message mechanism Jgroups and Amqp as infrastructure,This increases the system operation cost and complexity.
thanks.

They are two distinct concerns. CommandBus send a command to exactly one component, and has an (optional) return value. The Event Bus publishes to all interested components (possibly 0) and is inherently fire and forget.

Because of those concerns, JGroups isn’t genericly applicable to event buses and AMQP isn’t always the best fit for a command bus. However, nothing stops you from implementing a JGroupsTerminal or an AMQPConnector on the distributed command bus.

Cheers,

Allard