Yes this can be achieved, all that is required is to create a new subscription, e.g. "A_2", and use the subscriptionInitialPosition parameter to specify that you want to start consuming messages from the earliest available message as shown:
return getClient().newConsumer()
.topic(topic)
.subscriptionName("A_2")
.subscriptionType(SubscriptionType.Exclusive)
.subscriptionInitialPosition(SubscriptionInitialPosition.Earliest)
.subscribe();
This assumes that the messages haven't been deleted due to message retention policies.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…