For that moment of time there are two ways of sending message (to all available connections and to one specific) I want to extend this by providing a list of connection keys for broadcasting a message. Addition to this I want to be notified about that one or more connections were not available and have not received the message. So I can handle this situation somehow for example store the message or re send.
To solve this
1) I create a new constant CONNECTION_KEY_LIST = "websocket.connectionKey.list"
for transferring connections which should receive the message and ERROR_TYPE = "websocket.errorType"
MESSAGE_NOT_SENT_ERROR_TYPE = 1
to mark the callback event when some connections have not received the message.
2) create sendNotDeliveredMessage method in WebsocketConsumer for re sending the error event.
3) change WebsocketEndpoint to provide access to WebsocketConsumer
4) change WebsocketProducer to handle a new case (broadcast to defined list of connections and send error event in case some connections have not received the message)