I was wondering how to send messages to another user using Progress 4gl. We are trying to cut down on the PA speaker where I work and I want some way to notify a certain user/users of some predefined messages. I'm not sure if this is even possible with Progress, or if there is a message queue that can be used. If anyone has any samples, ideas or has done this before, please let me know. Thanks!!
问题:
回答1:
You might find this helpful:
Following on from presentations in Boston and Finland, dot.r is pleased to announce the open source Stomp project, available immediately.
Download from either http://www.dotr.com or https://bitbucket.org/jmls/stomp , the dot.r stomp programs allow you to connect your progress session to any other application or service that is connected to the same message broker.
Open source , free message brokers that support Stomp are :
Fuse (http://fusesource.com/products/fuse-mq-enterprise/)
[a Progress company now owned by Red Hat inc] Fuse MQ Enterprise is a standards-based, open source messaging platform that deploys with a very small footprint. The lack of license fees combined with high-performance, reliable messaging that can be used with any development environment provides a solution that supports integration everywhere
ActiveMQ (http://activemq.apache.org/)
Apache ActiveMQ (tm) is the most popular and powerful open source messaging and Integration Patterns server. Apache ActiveMQ is fast, supports many Cross Language Clients and Protocols, comes with easy to use Enterprise Integration Patterns and many advanced features while fully supporting JMS 1.1 and J2EE 1.4.
Apache ActiveMQ is released under the Apache 2.0 License
RabbitMQ
RabbitMQ is a message broker. The principal idea is pretty simple: it accepts and forwards messages. You can think about it as a post office: when you send mail to the post box you're pretty sure that Mr. Postman will eventually deliver the mail to your recipient. Using this metaphor RabbitMQ is a post box, a post office and a postman.
The major difference between RabbitMQ and the post office is the fact that it doesn't deal with paper, instead it accepts, stores and forwards binary blobs of data - messages.
Please feel free to log any issues on the https://bitbucket.org/jmls/stomp issue system, and fork the project in order to commit back all those new features that you are going to add ...
dot.r Stomp uses the permissive MIT licence (http://en.wikipedia.org/wiki/MIT_License)
Have fun, enjoy !
Julian
I tried it -- the code is dead-simple to install and run. And peeking inside the source is a pleasure.
ApacheMQ is pretty much painless to get going. This is a really, really easy way to get going with messaging.
If you are an old character-based fossil (such as myself) you might want to skip the GUI samples. You can send a message with:
/* stompQOut.p
*
*/
dotr.Stomp.Helper.SendMessage:ToQueue("myQueue","a test message")
And receive messages with:
/* stompQIn.p
*
*/
define variable stompClient as dotr.Stomp.StompClient no-undo.
define variable msgTxt as character no-undo format "x(60)".
stompClient = new dotr.Stomp.StompClient().
stompClient:Subscribe( this-procedure ).
stompClient:SubscribeToQueue( "myQueue" ).
pause 0 before-hide.
wait-for close of this-procedure.
procedure NewStompMessage:
define input parameter stompMessage as dotr.Stomp.StompMessage no-undo.
message string( stompMessage:Body ).
end.