centiservice / mats3

Mats3: Message-based Asynchronous Transactional Staged Stateless Services
https://mats3.io/
Other
63 stars 7 forks source link

On @MatsMapping, have an 'idPrefix' value, using the method name as last part. #11

Open stolsvik opened 6 years ago

stolsvik commented 6 years ago

Could be nice:

@MatsMapping(idPrefix = "OrderService")
public PlacedOrderDto placeOrder(OrderDto order) { .. }

.. and get an endpoint Id'ed as "OrderService.placeOrder".

Could also let that @MatsMapping adorn the class with the prefixId set, and then you would not have to put any values on the @MatsMapping on the methods. @MatsMapping on class could also implicitly specify the Spring's @Service.

@MatsMapping(idPrefix = "OrderService")
public class OrderServiceMatsEndpoints {
    @MatsMapping
    public PlacedOrderDto placeOrder(OrderDto order) { .. }

    @MatsMapping
    public PlacedOrderDto cancelOrder(String orderId) { .. }
}

Might need to use something like @MatsMappingService to distinguish the two annotations..