Hi Alex,

2nd reply mail to your first one.
# I'm writing this mail in Outlook (on Windows Japanase-edition),
# if there is somethin wrong please tell me.
        
>       If I'm understanding Carriers correctly we can have say one server 
>       with a queue which is then checked by other AP4R 
>       servers which then execute those messages on local threads. 

It's correct! # Sorry for poor documentation.
 
>       Can those servers accept messages to a local queue as 
>       well or do they just take messages over carrier? 

Every AP4R process is on top of reliable-msg as you know,
so it can accept messages.
As for carriers, they are just "clients" in the sense of reliable-msg.
They fetch messages from remote queues and put them into local queues
of the same name.
        
>       When we do async_to calls using the controller/action format 
>       (ap4r.async_to( {:controller => ...', :action => '....'} ,,,)) the 
>       message seems to keep the port number of the app that called it, 
>       obviously we can specify a full url and get round this 
>       but is there a more elegant solution? 
        
async_to uses url_for inside. I think there are two workaround.
One is to use a URL rewrite filter in dispatcher's configuration. 
There is just one document but in Japanese (Sorry again).
  http://gihyo.jp/dev/feature/01/ap4r/0002?page=5
  # Figures and code samples are in ASCII.
Example is as follows:
==== 
dispatchers:
  - targets: queue.*
    threads: 3
    modify_rules:
      url: proc {|url| url.port = 4001 + rand(3)}
====
You can rewrite :target_url by proc as you like. The block parameter "url"
is an instance of URI::HTTP.
But this proc is "eval"ed every time, so it needs to be refactored.

Another one is, somewhat brute force, redefine 
Ap4r::AsyncHelper::Converters::Http#make_rm_options.
rdoc is here 
http://ap4r.rubyforge.org/doc/classes/Ap4r/AsyncHelper/Converters/Http.html#M000077

Thanks,
shino

_______________________________________________
ap4r-user mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ap4r-user

Reply via email to