do not subscribe if no need to publish message

do not subscribe if no need to publish message.

1. subscribe input
2. advertise output according to the input message
3. unsubscribe input
4. check the number of subscribers of the output and if the number is greater equal than 1,
subscribe ~input again and relay the message