Here is the patch.

Index: lib/stomp.rb
===================================================================
--- lib/stomp.rb        (revision 87)
+++ lib/stomp.rb        (working copy)
@@ -23,16 +23,17 @@
   # synchronous receives
   class Connection

-    def Connection.open(login = "", passcode = "", host='localhost',
port=61613, reliable=FALSE, reconnectDelay=5)
-      Connection.new login, passcode, host, port, reliable, reconnectDelay
+    def Connection.open(login=nil, passcode=nil, host='localhost',
port=61613, clientId=nil, reliable=false, reconnectDelay=5)
+      Connection.new login, passcode, host, port, clientId, reliable,
reconnectDelay
     end

     # Create a connection, requires a login and passcode.
     # Can accept a host (default is localhost), and port
     # (default is 61613) to connect to
-    def initialize(login, passcode, host='localhost', port=61613,
reliable=false, reconnectDelay=5)
+    def initialize(login=nil, passcode=nil, host='localhost', port=61613,
clientId=nil, reliable=false, reconnectDelay=5)
       @host = host
       @port = port
+      @clientId = clientId
       @login = login
       @passcode = passcode
       @transmit_semaphore = Mutex.new
@@ -54,7 +55,11 @@
           @failure = NIL
           begin
             s = TCPSocket.open @host, @port
-            _transmit(s, "CONNECT", {:login => @login, :passcode =>
@passcode})
+            params = {}
+            params["login"] = @login if @login and @login != ''
+            params["passcode"] = @passcode if @passcode and @passcode != ''
+            params["client-id"] = @clientId if @clientId and @clientId !=
''
+            _transmit(s, "CONNECT", params)
             @connect = _receive(s)
             # replay any subscriptions.
             @subscriptions.each { |k,v| _transmit(s, "SUBSCRIBE", v) }




Enrico Teotti wrote:
> 
> well done mate!
> Where is the code atm? Can I take a look at it?
> Cheers
> 
> 2008/9/10 Eugene79 <[EMAIL PROTECTED]>:
>>
>> Got reply from Andrew Kuklewicz. He said he will incorporate the changes.
>>
>> Eugene
>>
>>
>>
>> bsnyder wrote:
>>>
>>> On Tue, Sep 9, 2008 at 12:55 PM, Eugene79 <[EMAIL PROTECTED]> wrote:
>>>>
>>>> I contacted the guy who is listed as the project admin on rubyforge. He
>>>> says
>>>> he doesn't maintain it anymore, and the code actually lives at
>>>> stomp.codehaus.org. I posted on their forum, and so far got no reply.
>>>> The
>>>> last post on stomp-dev is from May 11. Does anybody actually maintain
>>>> that
>>>> code anymore?
>>>
>>> Let me see what I can do.
>>>
>>> Bruce
>>> --
>>> perl -e 'print
>>> unpack("u30","D0G)[EMAIL PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
>>> );'
>>>
>>> Apache ActiveMQ - http://activemq.org/
>>> Apache Camel - http://activemq.org/camel/
>>> Apache ServiceMix - http://servicemix.org/
>>>
>>> Blog: http://bruceblog.org/
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/durable-subscriber-support-in-stomp.rb-tp19381804p19401525.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> 
> -- 
> Enrico Teotti
> IT consultant, accessible web sites and web applications
> Sydney, NSW, Australia
> [EMAIL PROTECTED]
> mobile (IT) +393286590765
> mobile (AU) +00610416748450
> 
> http://www.teotti.com
> 
> 

-- 
View this message in context: 
http://www.nabble.com/durable-subscriber-support-in-stomp.rb-tp19381804p19423274.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to