Hi Devs,

Following is my vision on intregating topics to MB

>> we duplicate metadata per subscriber. It will not create a big overhead.
>> we do not duplicate content per subscriber, but we duplicate content per
node
>> I hereby assume that we do handle acks for topics. We need a reasearch
on that.

When a topic subscriber is created
1. qpid creates a temp queue
2. qpid creates a binding for that queue to topic exchange using topic name
as binding key.
3. qpid creates a subscription for the temp queue.

when a topic subscriber is closed qpid does above 3 things in reverse
order.

Adhering to this model,

1. We store metadata in the same way we use for normal queues.
2. We use the same SlotDelivery worker and the flusher. There is NOTHING
called topic delivery worker
3. when show in UI we filter durable ones and show
4. when a subscriber closes, queue is deleted. We do same thing as for
normal queues.
5. Whenever we insert metadata, we duplicate metadata for each temp queue
(per subscriber). We know the nodes where subscriers lies, do we can
duplicate content for those nodes (one copy for node).
6. We need to introduce a new tracking per subscriber in on flight message
tracker, which is common for queues as well. when a metadata is inserted
for a message id we increase a count.
    When an ack came for that metadata we decrement it. If it is zero,
content is ready to be removed. we do not track this count globally as we
have a copy of content per node. Thus reference count do not need to be
global. It is a local in-memory tracking.
7. queue change handler - if delete - execute normal delete (remove all
metadata), decrement reference counts. Thread that delete content will
detect that and will delete offline. This way only if all subscribers are
gone, content is removed.

8. Should be careful abt hierarchical topics. We use our maps to identify
queues bound to a topic. MQTT, AMQP confusion should be solved there.


-- 
*Hasitha Abeykoon*
Senior Software Engineer; WSO2, Inc.; http://wso2.com
*cell:* *+94 719363063*
*blog: **abeykoon.blogspot.com* <http://abeykoon.blogspot.com>
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to