AntonRoskvist commented on PR #4681:
URL: 
https://github.com/apache/activemq-artemis/pull/4681#issuecomment-1905583151

   Thanks for your feedback @jbertram 
   
   I'd argue that the behavior already is configurable though, through the 
"auto-create"-configs in the address-settings...
   
   As for the performance implication, I agree that this could have some 
additional cost associated with it... however the same operation is carried out 
during normal routing within the postOffice, twice... at 
`PostOfficeImpl#checkAddress()` and `PostOfficeImpl#simpleRoute()`.
   
   The reason they are not applied for the diverted messages is because the 
message copies does not have a reference back to their original 
`ServerSession`... don't know if this is safe, but perhaps the Divert could do 
this instead:
   
   `postOffice.route(copy, new 
RoutingContextImpl(context.getTransaction()).setReusable(false).setRoutingType(copy.getRoutingType()),
 false);`
   
    --->
   
   `postOffice.route(copy, new 
RoutingContextImpl(context.getTransaction()).setReusable(false).setRoutingType(copy.getRoutingType()).setServerSession(context.getServerSession()),
 false);`
   
   That way the currently implemented auto-create-logic within PostOffice would 
apply instead. Thoughts on this?
   
   And just to be clear, I'd be open to re-implement all together according to 
your suggestion if you think that makes more sense, just let me know.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to