dot.r Stomp announcement - Forum - OpenEdge Development - Progress Community
 Forum

dot.r Stomp announcement

  • OK received the 'socket is disconnected' message today 3 times in a row after closing the menu.

    I suppose socket disconnections can happen when there is a glitch on the network (this is actually running over the internet so no wonder).

    However, what is strange is that I am getting these only after closing the menu and several times.

    If it happened earlier I could try a (silent) reconnect before displaying an error message.

    Any ideas?

  • Are you running on EC2 ?

    We have had some major issues with the network "glitching" , so

    clients like putty get disconnected after a very short time .

    Stomp also has the problem, but so does ActiveMQ using jms clients, so

    it's not progress

    Also, which "menu" are you talking about ? Can you manually close the

    client before you close the app ? GC does not always delete objects in

    the "right" order, so sometimes we manually delete objects in the

    order that we want them destroyed

    On 12 October 2012 16:58, Peter van Dam

  • marianedu wrote:

    this is how the write method looks like in my own socketoutputbuffer... maybe can be easily adapted there

    method override public void write( input bytes as memptr, input offset as integer, input len as integer ):
          if bytes eq ? or offset eq ? or len eq ? then
             undo, throw new NullPointerException().
            
          if len eq 0 then
             return.
         
          if offset lt 0 or len lt 0 or offset + len gt get-size(bytes) then
             undo, throw new ArrayIndexOutOfBoundsException().
         
          checkClosed().
          do while len gt 0:
             outSocket:write(bytes, offset + 1, len) no-error.
             if outSocket:bytes-written eq 0 then
                undo, throw new IOException().
             assign
                offset = offset + outSocket:bytes-written
                len    = len    - outSocket:bytes-written.
          end.
    end method.



    Error handling code similar to the above has been implemented and in the latest push. Thanks Marian.

  • thanks very much for the great comments.

    Both of your suggestions are implemented in the latest version

    Thanks for trying it out !

  • You're welcome Sir.

    See you have more focus on that one, maybe something you can pick-up from the unfinished attempt I had on the subject http://sourceforge.net/p/progress-jms/code/102/tree/net.sourceforge.progress.jms/

  • I'm sure that I will be able to steal lots of ideas from it

    I am but a "dwarf standing on the shoulders of giants" http://en.wikipedia.org/wiki/Standing_on_the_shoulders_of_giants

  • Are you running on  EC2  ?

    We have had some major issues with the network "glitching" , so

    clients like putty get disconnected after a very short time .

    Stomp also has the problem, but so does ActiveMQ using jms clients, so

    it's not progress

    Also, which "menu" are you talking about ? Can you manually close the

    client before you close the app ? GC does not always delete objects in

    the "right" order, so sometimes we manually delete objects in the

    order that we want them destroyed

    I am running over a normal internet connection (just for testing purposes).

    I have noticed that every morning the socket connection seems to have been lost overnight. This means that I don't know which messages I missed.

    The problem is that there is no 'disconnected' event I guess.

    So I am thinking of reconnecting the client every 10 minutes or so to avoid this issues. Is that normal practice?

  • I am running over a normal internet connection (just for testing purposes).

    I have noticed that every morning the socket connection seems to have been lost overnight. This means that I don't know which messages I missed.

    The problem is that there is no 'disconnected' event I guess.

    So I am thinking of reconnecting the client every 10 minutes or so to avoid this issues. Is that normal practice?

    Is the server on the internet, or both client and server ?

    If you use the latest version on bitbucket, I've added some error handling for socket disconnection. Stomp will now post an "error" message with the body of the message stating that the socket has been disconnected. You can now choose how to handle this (reconnect etc)

    let me know if it helps.

    If you are using ActiveMQ 5.7.0 or above, you could try adding the heartbeat option to the server, which "pings" the client every x milliseconds. This may help to maintain the connection as it is active.

    If you need to know which messages that you have "missed" you can always use a queue for the one subscriber - the messages will build up until that consumer joins

    Also, have a look at the Apache Apollo project (http://activemq.apache.org/apollo/documentation/user-manual.html) , which is going to the base of ActiveMQ 6 - there is an option to "retain" topic messages, which means that the last message sent to the topic is sent to each new subscriber

  • Peter, did you get a chance to look at the updates ?

    We're running with ApacheMQ 5.8 snapshot, seems very sold pumping hundreds of thousands of messages through per day

  • Just thought I'd post some details of stomp in real world use

    A snapshot of the ActiveMQ in operation at our call center.

    The "queue" in "pbx,queue" is not a stomp queue, it's an inbound call queue

    Each topic is automatically deleted after 30s inactivity

    NameNumber Of ConsumersMessages EnqueuedMessages Dequeued
    ActiveMQ.Advisory.Connection025152320
    ActiveMQ.Advisory.Consumer.Queue.ActiveMQ.DLQ0100
    ActiveMQ.Advisory.Consumer.Topic.pbx.queue.info...014570
    ActiveMQ.Advisory.Consumer.Topic.pbx.queue.warn...014570
    ActiveMQ.Advisory.MessageDLQd.Topic.pbx.queue.i...0130
    ActiveMQ.Advisory.MessageDLQd.Topic.pbx.queue.i...054430
    ActiveMQ.Advisory.MessageDLQd.Topic.pbx.queue.i...04230
    ActiveMQ.Advisory.MessageDLQd.Topic.pbx.queue.i...03070
    ActiveMQ.Advisory.MessageDLQd.Topic.pbx.queue.i...01140
    ActiveMQ.Advisory.MessageDLQd.Topic.pbx.queue.w...0100
    ActiveMQ.Advisory.MessageDLQd.Topic.pbx.queue.w...046420
    ActiveMQ.Advisory.Queue010
    ActiveMQ.Advisory.Topic0150
    debtnet.info.db.update.Campaign0520
    debtnet.info.db.update.CampaignData06026180
    debtnet.info.db.update.CampaignNumber05417430
    debtnet.info.db.update.ExtraData06430
    debtnet.info.db.update.Plan01470
    debtnet.info.db.update.Queue0300
    debtnet.info.db.update.SkillMatrix030
    pbx.queue.info.agentconnected53335714
    pbx.queue.info.hangup534552385
    pbx.queue.info.newcall534700309
    pbx.queue.info.team.removed53250
    pbx.queue.info.tryagent53509577929
    pbx.queue.info.voicemail5345867
    pbx.queue.warning.noagent5347885247530
    pbx.queue.warning.timedout532220

    and the broker details

    Broker

    Namelocalhost
    Version5.8-SNAPSHOT
    IDID:prometheus-1069-1350291226059-0:1
    Uptime7 days 3 hours
    Store percent used0
    Memory percent used1
    Temp percent used0
  • Hi Julian,

    I would like to use synchronous (request-response) messaging. Therefore support for properties such as 'correlation-id' and 'reply-to' should be added.

    Currently this is not quite possible since although there is a StompMessage class, this class is not used for sending messages. The current header is constructed hardcoded in the Send() method in StompClient.cls as a string.

    I would rather start using the StompMessage class so I can add those properties and be more flexible in the future.

    As I am writing this I realize I suppose I could implement that without breaking the code by adding overloads.

    What do you think?

    -peter

  • Hi Peter - have a look at the WithHeader method on the stompclient. This method allows you to add headers of your own choice

    Julian

  • jmls wrote:

    Hi Peter - have a look at the WithHeader method on the stompclient. This method allows you to add headers of your own choice

    Julian

    OK I guess that will work.

  • rbf wrote:

    jmls wrote:

    Hi Peter - have a look at the WithHeader method on the stompclient. This method allows you to add headers of your own choice

    Julian

    OK I guess that will work.

    I am trying to do this but it does not seem to work.

    I think the headers are OK but there is this thing called creating a Temporary Queue that I don't seem to be able to achieve.

    Do you know how to do that?

  • right, I see part of the problem

    given this scenario

    a) producer subscribes to /temp-queue/response
    b) then sends a message with reply-to header set to "/temp-queue/response"
    c) the consumer gets the message , with reply-to set to "/remote-temp-queue/ID\cjmls-study-49161-1353295140603-2\c463\c1"
    d) and responds to that reply-to address
    e) sure enough, message appears on the queue list of ActiveMQ , but with 0 consumers, so the message just sits there waiting
    f) the producer is also just sitting around, waiting for the message as well, but is obviously not subscribed to the queue it needs to be

    I seem to smell a bug somewhere. ActiveMQ is meant to automatically subscribe the producer to the /remote-temp-queue/ID\cjmls-study-49161-1353295140603-2\c463\c1 queue, but either it is not, or the subscription is terminated before the response.

    I have asked the ActiveMQ folks for their read on the situation.

    In the meantime, we don't use temporary queues

    Each client that uses a stomp connection gets it's own guid using guid(generate-uuid) (let's call it "myguid") , and subscribes to that queue (/queue/myguid) . If we want a reqeust-response, set the reply-to to be "/queue/myguid", and manipulate the other headers as required.

    The consumer of the message should use the reply-to header to send the information back to the orginal producer (in this case, using the /queue/myguid queue )

    HTH

    Julian