I have an ActiveMQ plugin to track subscriptions and other stuff.
Moreover, if I re-create the route after a while, the route processes the
messages received once it is supposed to be removed.
The GC is done by a custom plugin since my use case doesn’t fit in any
“regular” ActiveMQ GC.
Anyway, if I force the destination deletion, my plugin is able to delete the
queue.
And when I re-create the route, the route doesn’t process any previous message.
To give you some more detail, I’m experimenting with the REST routes using the
http4 endpoint but, the endpoint itself, is plugged to the context with a
different schema like:
<bean id="my-route-id-one"
class="org.apache.camel.component.http4.HttpComponent">
...
</bean>
you can see the netstat output in attachment.
> Il giorno 30 mar 2020, alle ore 16:19, Ralf Claussnitzer
> <[email protected]> ha scritto:
>
> The route shutdown and removal appears to work.
>
> Where do you see this active subscription?
>
> Does it disappear when you GC the ActiveMQ component alltogether?
>
> Can you show the result of `netstat -atp` on the Broker machine?
>
> On 3/30/20 11:54 AM, Modanese, Riccardo wrote:
>> Hi
>> I switched the log to DEBUG level and I simplified the test leaving
>> only one route (and reducing the concurrent consumers from 2 to 4).
>>
>> The issue still happens.
>>
>> ActiveMQ has a subscription:
>>
>> queue://Consumer.my-route-subs-id:EXACTLY_ONCE.VirtualTopic.my-subs.>
>>
>> with one consumer and no pending messages after the route is removed.
>>
>>
>> You can see the extracted log in attachment.
>>
>>
>>
>>
>>
>>
>> > Il giorno 30 mar 2020, alle ore 07:27, Ralf Claussnitzer
>> > <[email protected]> ha scritto:
>> >
>> > Hi Riccardo,
>> >
>> > what is happening in DEBUG log when you call the remove?
>> >
>> > Maybe you are dealing with inflight exchanges here?
>> >
>> > Can you try to instead just stop the routes?
>> >
>> > -Ralf
>> >
>> > On 3/27/20 2:20 PM, Modanese, Riccardo wrote:
>> >> Hi all,
>> >>
>> >> I'm experimenting with programmatically routes creation and removal
>> >> (Camel version 2.17).
>> >> The routes are created and removed at runtime through my custom
>> >> RouteBuilder instance and are consuming from ActiveMQ 5 (with virtual
>> >> topic enabled).
>> >> Once a route is removed (*) all the subscriptions (for this specific
>> >> route) to the broker are removed except for one.
>> >> So one subscription to the broker still remains active.
>> >>
>> >> Unfortunately I have no simple test code to reproduce the behavior I'm
>> >> seeing.
>> >>
>> >> Has someone any idea if I'm missing something or can point me to the
>> >> right direction?
>> >>
>> >> Thank you.
>> >>
>> >> Riccardo
>> >>
>> >>
>> >> (*)
>> >> getContext().removeRouteDefinition(getContext().getRouteDefinition(routeId));
>>
BEFORE ROUTE REMOVAL
sh-4.2$ netstat -atp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 0 0 127.0.0.11:34695 0.0.0.0:* LISTEN
-
tcp 0 0 0.0.0.0:avt-profile-2 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:61614 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:61615 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:61616 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:secure-mqtt 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:35671 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:ibm-mqisdp 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:patrol-snmp 0.0.0.0:* LISTEN
1/java
tcp 0 0 862b90aedb06:ibm-mqisdp gateway:50840 ESTABLISHED
1/java
tcp 0 0 862b90aedb06:ibm-mqisdp gateway:50796 ESTABLISHED
1/java
tcp 0 0 862b90aedb06:ibm-mqisdp gateway:50824 ESTABLISHED
1/java
tcp 0 0 862b90aedb0:patrol-snmp gateway:55176 ESTABLISHED
1/java
AFTER ROUTE REMOVAL
sh-4.2$ netstat -atp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
PID/Program name
tcp 0 0 127.0.0.11:34695 0.0.0.0:* LISTEN
-
tcp 0 0 0.0.0.0:avt-profile-2 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:61614 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:61615 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:61616 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:secure-mqtt 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:35671 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:ibm-mqisdp 0.0.0.0:* LISTEN
1/java
tcp 0 0 0.0.0.0:patrol-snmp 0.0.0.0:* LISTEN
1/java
tcp 0 0 862b90aedb06:ibm-mqisdp gateway:50840 ESTABLISHED
1/java
tcp 0 0 862b90aedb06:ibm-mqisdp gateway:50796 ESTABLISHED
1/java
tcp 0 0 862b90aedb06:ibm-mqisdp gateway:50824 ESTABLISHED
1/java