Elizabeth,
In order to make this kind of routing work without looping, set the source connection in the message metadata to the new (or “middle”) thread before setting the “over” disposition, like this:
#######################
global HciConnName
if { ! [info exists HciConnName] } { set HciConnName “UNKNOWN_THREAD” }
set thread $HciConnName
msgmetaset $mh SOURCECONN $thread
lappend dispList “OVER $mh”
#######################
This makes thread “B” the new source thread instead of thread A and prevents the message from looping.
There are other issues to be aware of with this kind of routing — the same routes must appear in thread A as in thread B, and the trxid in both threads needs to be able to handle them appropriately. Unless I’ve missed something, which is entirely possible.