[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Maximum path length easly exceeded
by timfox
"clebert.suconic(a)jboss.com" wrote : I can't just store destinations on a TXT. If the user is creating and deleting destinations very frequently (say temporary destinations), when routing we will be creating too many entires on the TXT.
|
There will only ever be one address in the tx file -there is one text file per address.
anonymous wrote :
| Besides the TXT could be easily broken by crashes.
|
The paging files could also be broken by crashes, it's no different.
anonymous wrote :
| What took some time yesterday was creating the directory lazily... not adding a record on the Journal, and replacing the journal by a TXT on that part would be the same complexity. On the process I had screwed up one thing and it took me some time to figure out.
|
| What I have done was only create the entry when it was in page mode, and remove the destinations from the storage as soon as it left the page-mode.
|
Not a good idea - there's no need to do this especially if the address is flipping between paging and not, you will get a lot of thrashing.
The text file will only ever be created once - when a destination starts paging.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199762#4199762
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199762
15 years, 3 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Algorithm broken in WildcardAddressManager
by ataylor
Thats exactly my understanding apart from
anonymous wrote : But the important point here is there is no guarantee check allowable = true. If checkAllowable = false then probably the list of allowable destinations is empty even though there are many queues, so you can't rely on it.
We always populate allowable destinations no matter what checkallowable is set to.
anonymous wrote : In which case, I really don't understand your explanation. Perhaps you could start again.....?
Ok, lets forget JMS for now. when a queue is created with a wildcard say 'queue.*' then its binding will also be added to 'queue.a', 'queue.b' etc. This means that when a message is routed to either queue.a or queue.b it is delivered to any consumers registered with queue.*. If a new queue queue.c is added after the fact then it also has the binding added.
The problem comes, like you say, for topics. lets say a consumer registers with topic.*, unless there is already another consumer registered with topic.a then any messages routed to topic.a won't get routed since we haven't added topic.*'s binding to topic.a. This is the reason i was originally creating all the combinations. To solve this I can either also check the destinations to see if theres any i have missed or , which is simpler, make sure I always add a mapping for any added destination. This doesn't change the functionality, if it happens that a message is routed to an address with an empty bindings then thats ok.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199760#4199760
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199760
15 years, 3 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Maximum path length easly exceeded
by clebert.suconic@jboss.com
I can't just store destinations on a TXT. If the user is creating and deleting destinations very frequently (say temporary destinations), when routing we will be creating too many entires on the TXT.
Besides the TXT could be easily broken by crashes. That's why I have used the journal.
What took some time yesterday was creating the directory lazily... not adding a record on the Journal, and replacing the journal by a TXT on that part would be the same complexity. No creating the destination itself, but on the process I had screwed up one thing and it took me some time to figure out.
What I have done was only create the entry when it was in page mode, and remove the destinations from the storage as soon as it left the page-mode.
I don't think a simpler solution as you suggest would be the best idea because of the first point I'm raising here.
I will come online to discuss this in 30 min
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199759#4199759
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199759
15 years, 3 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Algorithm broken in WildcardAddressManager
by timfox
"ataylor" wrote : anonymous wrote : Like I said before, there is no guarantee that an allowable destination exists - this is only used for JMS!!
| |
| | You're assuming there always an allowable destination for every address that can be routed to - that is not correct.
| |
| | Allowable destinations are only used if checkAllowable is true.
|
| I'm not using the allowable destinations to decide on routing, I'm using whatever mappings exist. If there is no allowable address but just a mapping thats fine, it will work. Currently the only place it doesn't is like you say when theres an allowable destination but no mappings. i.e. a topic with no registered consumers. All I'm doing is making sure that theres always a mapping for every allowable destination, the only difference is that it may contain no binding's.
In which case, I really don't understand your explanation. Perhaps you could start again.....?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199754#4199754
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199754
15 years, 3 months
[Design of Messaging on JBoss (Messaging/JBoss)] - servlet transport implementation
by ataylor
At the minute I'm still adding some jboss as 5 integration so i can run this, but in essence this is how i see it working.
On the client side we use the netty http transport to send messages to the servlet, there'll probably be changes needed around keep alive etc and I'll also use session id's in the Http requests.
On the server side we have 2 main components.
An HttpSessionListener which we use to maintain actual INVM connections. This means we can tidy up connections when sessions timeout. We can also control the timeout and have it configurable in the usual transport manner. Th einvm connection will be added to th eservlet context making it available in the servlet
The servlet itself. All this basically does is forward the content to th einvm connection and return any responses available.
Again, this will support true 1 - 1 request/response cardinality and I'll add support for both keep alive and separate requests.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199753#4199753
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199753
15 years, 3 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Algorithm broken in WildcardAddressManager
by timfox
Let me sum up, since it seems this is a very common misunderstanding - Clebert made the same mistake the other day. I've explained it before on this forum but I'll explain it again....
Why do we have "allowable addresses"? (A.K.A "destinations" in AddressManager)
In an ideal world, we wouldn't have them at all. We would just bind queues to addresses, and route messages to addresses, so we'd just need mappings of addresses to queues.
That's the way core works when checkAllowable is set to false. In that case we don't care about allowable destinations - they're never populated or queried - we just bind queues to addresses and route them.
The reason we introduced allowable addresses is because of a JMS difficulty. In JMS it is illegal to send a message to a topic which doesn't "exist".
But in core, how do we know if a topic "exists" if it has no subscribers? A topic with no subscribers in core is indistinguishable from no topic at all since we're just binding queues to address.
So.... to allow JMS to work correctly we needed some way in core to denote a topic that has been "deployed" but has no subscribers. Hence the allowable addresses.
If you set checkAllowable = true, then the post office will only allow routing to addresses in the set of allowable destinations. So, for JMS we make sure we call add destination for each JMS queue or topic deployed.
But the important point here is there is no guarantee check allowable = true. If checkAllowable = false then probably the list of allowable destinations is empty even though there are many queues, so you can't rely on it.
Hope that's clearer.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199751#4199751
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199751
15 years, 3 months
[Design of Messaging on JBoss (Messaging/JBoss)] - Re: Algorithm broken in WildcardAddressManager
by timfox
"ataylor" wrote : anonymous wrote : How can you add a mapping for each allowable address if there are no allowable addresses? .....
| |
| | Perhaps there is a terminology mix up here?
|
| By allowable address I'm assuming you mean a destination!
|
Yes I believe you removed the "allowable" when you moved them from postoffice to address manager.
anonymous wrote :
| so in SimpleAddressManager we would have
|
|
| | public boolean addDestination(final SimpleString address)
| | {
| | Bindings bindings = new BindingsImpl();
| | mappings.putIfAbsent(address, bindings);
| | return destinations.addIfAbsent(address);
| | }
|
| this means that all destinations exist in the mappings object, except that they may have an empty Bindings object. This also means that when i check for matching addresses i don't have to check both the destinations and the mappings only the mappings. Taking this further if they exist in both destinations and mappings we don't need destinations, we can just check in the mappings, if theres an entry then its an allowable address, i.e. it has a mapping, empty or not.
Like I said before, there is no guarantee that an allowable destination exists - this is only used for JMS!!
You're assuming there always an allowable destination for every address that can be routed to - that is not correct.
Allowable destinations are only used if checkAllowable is true.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199747#4199747
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4199747
15 years, 3 months