Hi Johan
Thanks for your response. I'll try implementing it and submitting a PR.

Best Regards
Rafał

W dniu piątek, 28 lipca 2017 09:11:49 UTC+2 użytkownik Johan Andrén napisał:
>
> In many cases it may be a sign that something is wrong when there are no 
> subscribers, for example because topic name was misspelled etc. Just like 
> how other messages ending up in dead letter could indicate a problem but 
> might be normal. 
>
> It is also useful when debugging, if for example a subscription has not 
> yet been gossiped to a node when a message is published to a topic. 
>
> The feature was added in 2.4.5, here's the issue: 
> https://github.com/akka/akka/issues/19009
>
> I think we'd be open for a PR making this configurable, keeping the 
> current behaviour as default. If you're not up for that then adding a dummy 
> subscriber sounds like a possible solution.
>
> --
> Johan 
> Akka Team
>
> On Saturday, July 22, 2017 at 4:02:35 PM UTC+2, Rafał Sumisławski wrote:
>>
>> Hi,
>>
>> I was surprised to discover that the DistributedPubSub does not simply 
>> forward a published message to all (0 or more) subscribers for a given 
>> topic. There's a special case implemented to send the message to the 
>> DeadLetter in case there are no subscribers for that topic (
>> https://github.com/akka/akka/blob/9d2bec7f232b628cc087231af75e457072823e61/akka-cluster-tools/src/main/scala/akka/cluster/pubsub/DistributedPubSubMediator.scala#L716).
>>  
>> Sending these messages to DeadLetter makes it look like it's something 
>> wrong, while IMO it's a perfectly valid and common use case for 
>> publish-subscribe pattern to have 0 or more subscribers. I see value of 
>> this behaviour during debugging, but it's strange that it's a default and 
>> as far as I can see it can't be disabled. 
>>
>> What is the reason why DistributedPubSub is implemented this way?
>>
>> What is the best way to avoid published messages ending up in the 
>> DeadLetter? Currently I'm spawning a fake subscriber actor (usually one per 
>> node) for each topic I plan to publish some messages to.
>>
>> Best Regards
>> Rafał
>>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to