From reading the link you sent, it seems like this is automatically performed by the broker when multiple consumers are on the same queue, using the transport header to dispatch messages with the same GroupID to the same consumer. If you can confirm the header is indeed being set on the message when it is delivered to the queue, it seems like something inside ActiveMQ that would take it from that point.
If the transport header isn't present on messages in the queue, then something else is wrong.
It also might be useful to try sending to a queue directly (using GetSendEndpoint(address), followed by Send(...)), instead of using publish, to see if the header is being lost due to the publish/subscribe semantics of how ActiveMQ is used in that scenario. I don't think that should matter, but only mentioning it since sometimes brokers do different things depending upon the message delivery semantics.