Prevented an issue where a large number of order items and/or fulfillment items can cause OrderCreatedEvent & VoucherGenerationCompletionEvent message payloads to bloat to the point that it exceeds the message broker’s maximum message size limit. This is done by not populating the Order object & OrderFulfillment collection on these events, & instead, providing links to optionally retrieve this data via API calls. This feature is enabled by default, but if you need to turn it off, set false to the following properties:
broadleaf.orderoperation.messaging.order.created-event-links-enabled
If true, then the OrderCreatedEvent will contain the links to read the Order and Order Fulfillments
If false, then the OrderCreatedEvent will continue to include the Order and Order Fulfillments.
broadleaf.orderoperation.messaging.voucher-generation-completion-event-links-enabled
If true, then the VoucherGenerationCompletionEvent will contain the links to read the Order
If false, then the VoucherGenerationCompletionEvent will continue to include the Order.
|
Note
|
If you have any custom listeners for OrderCreatedEvents or VoucherGenerationCompletionEvents that require the order or fulfillments, they’ll need to be updated to read these entities using the OrderCreatedEvent.links or VoucherGenerationCompletionEvent.links values. For an example, see usages of the readAllByOrderFulfillmentLink and/or readByOrderLink components referenced below.
|
The changes in the OrderCreatedEvent event
The OrderCreatedEvent.fulfillments is deprecated and shouldn’t be used
The OrderCreatedEvent.order is deprecated and shouldn’t be used
The OrderCreatedEvent.links map is added. This map contains the API URLs information to read the Order and Order fulfillments if needed.
order - the key to get the link from the map to read the Order
orderFulfillments - the key to get the link from the map to read the Order fulfillments
The changes in the VoucherGenerationCompletionEvent event
The VoucherGenerationCompletionEvent.order is deprecated and shouldn’t be used
The VoucherGenerationCompletionEvent.links map is added. This map contains the API URLs information to read the Order.
order - the key to get the link from the map to read the Order
com.broadleafcommerce.orderoperation.service.messaging.OrderLinksService - the new service that is used to build the links that can be added to the message payloads and used by message listeners to fetch the additional data if needed
FulfillmentProvider.readAllByOrderFulfillmentLink - the new method that is used to read the Order fulfillments by the link from the event. These links ultimately point to this endpoint in OrderServices to read fulfillments by order id.
OrderProvider.readByOrderLink - the new method that is used to read the Order by the link from the event. These links ultimately point to this endpoint in OrderServices to read orders by id.