EAS306

Information about EAS306

Published on November 21, 2007

Author: Eagle

Source: authorstream.com

Content

EAS306 Building a Chat Server with EAServer and PowerBuilder:  EAS306 Building a Chat Server with EAServer and PowerBuilder Dean Jones [TeamSybase] CEO of PowerObjects [email protected] (612) 339-3355 Who We Are…:  Who We Are… PowerObjects Multi-Million dollar consulting company Sybase Consulting Partner Value Added reseller Premier consulting partner Custom Solution Provider Specialize in EAServer and Web Development Offer Web application hosting Certified Developers staff PowerBuilder, Java and Microsoft Certifies Member of Team Sybase Overview:  Overview Building a Chat server using PowerBuilder and EAServer Using Java Message Service Publishing Messages Subscribing to Messages PowerBuilder Components Pushed messages onMessage Event Taking it one step further Message Service:  Message Service EAServer’s message service provides a powerful means by which to leverage multiple threads in your distributed applications Message Service:  Message Service The message service provides queues for message consumers Allows message producers to send messages to specified queues (point-to-point messaging) Publish messages with specified topics that may be of interest to registered consumers (publish/subscribe messaging) There are two parts to the message service A Publisher A Consumer Message Service:  Message Service Publishing Messages:  Publishing Messages To publish a message, there are three steps: Create a proxy for message service Populate the message Publish PowerBuilder Proxy:  PowerBuilder Proxy Before you can send a message to the queue you must generate MessageService Proxy NOTE: The objects created will have an issue with wchar To fix you must edit the source and replace wchar data type with String data type Populate the Message:  Populate the Message A message is a structure of information to send to the server Publish:  Publish Publish a message with the specified message topic. A copy of this message will be sent to the queues for all consumers who have registered a message selector that returns TRUE when applied to this message void publish ( in string topic, in CtsComponents::Message msg, in long options ); Chat Application:  Chat Application You type a message into a single line edit and send when the user clicks Send. Chat Application:  Chat Application Consuming Messages:  Consuming Messages To retrieve messages, there are two options: First is to pull messages from a given queue Second option is to let the message service push messages EAServer cannot push messages to a PowerBuilder client application, it can only push messages to PowerBuilder component EAServer can push messages to a Java client Consuming Messages:  Consuming Messages Consumers of messages can either pull messages or have them pushed. There are three steps to pulling messages: Connect to the Message Service Specify a Queue and a Topic Receive messages To be a consumer of pushed messages, three steps must be taken: Implement Message Listener Code the onMessage event Register the receiving component using code or message service manager Connect to Message Service:  Connect to Message Service ctsComponents_MessageService cms ctscomponents_messageseq cseq ctscomponents_messagequeue cmsg ctscomponents_message cm ctscomponents_messagekey after string sz_queue int i connection c c = CREATE connection c.application = "" c.location = "iiop://jones-dean:9000" c.userid = "jagadmin" c.password = "sarah" c.driver = "jaguar" c.ConnectToServer() c.CreateInstance(cms, "CtsComponents/MessageService") Receive Messages:  Receive Messages sz_queue = cms.getUniqueName(1) cmsg = cms.getMessageQueue(sz_queue,"",0) cms.addselector(sz_queue, "topic='chat'" ) do while 1 < 2 //CtsComponents_Messageseq seq cseq = cmsg.receive( 0, 30 ) For i = 1 to UpperBound(cseq.item) cm = cseq.item[i] arg_notify.post of_notify( cm.Text ) after = cm.key Next loop return 1 Multi-Threading in PowerBuilder:  Multi-Threading in PowerBuilder Pushed Messages:  Pushed Messages Receiving messages that are pushed from the message service’s receive() method is straightforward. Code a component with an onmessage() method with the following signature: Return [none] onmessage( ctscomponents_message msg ) Pushed Messages:  Pushed Messages You can create a new component and add the onmessage() method or you can create a component that implements an existing interface In this example, we’ll add logic to the onmessage() method that writes to the log and indicates when the component is called Pushed Messages:  Pushed Messages It’s important to note that if you code a custom component that does not implement CstComponent/MessageListener, you must add this interface to your component using Jaguar Manager (Figure 12). The custom interface has the component’s actual IDL; you must add the MessageListener IDL Pushed Messages:  Pushed Messages After creating and deploying the component, you must go into Jaguar Manager and configure the message queue to listen for messages. Under Message Service you can configure a new queue. Do this by right clicking on Configured Queues and selecting New. Message flow:  Message flow Chat Client I Message Service Pull Messages Publish Message Push Messages EAServer Chat Client II n_messagelistener Client Side Taking it one Step Further:  Taking it one Step Further Keeping track of who’s connected Sending messages to selected users Receiving messages from selected users New Getting more Help:  New Getting more Help Mentoring New PowerBuilder 9 Book Internet and Distributed Application Development EAServer API Interface EAServer on-line help Forums New Getting more Help:  New Getting more Help Sybase Tools Seminar April 2004 Minneapolis, MN Over 150 Attendees Six Sessions Panel Discussion with all experts and Sybase product managers http://www.powerobjects.com/seminar Questions:  Questions Contact PowerObjects:  Contact PowerObjects Send E-mail and Questions: [email protected] Visit our Web-site: www.powerobjects.com Call Us: Office (612) 339-3355 Grab one of my business card:  Grab one of my business card Dean Jones Chief Executive Officer www.powerobjects.com 401 2nd Ave. S. Suite 843 Minneapolis, MN 55401 Office 612.339.3355 cell 612.701.4017 fax 612.339.4433 [email protected]

Related presentations


Other presentations created by Eagle

Practice of International Trade
03. 09. 2007
0 views

Practice of International Trade

final thesis presentation
29. 10. 2007
0 views

final thesis presentation

Nature ppt
03. 09. 2007
0 views

Nature ppt

Bridge Construction for class
30. 12. 2007
0 views

Bridge Construction for class

CIO 01
01. 01. 2008
0 views

CIO 01

30 Sept Cryptography
05. 01. 2008
0 views

30 Sept Cryptography

Poster3 XB
14. 09. 2007
0 views

Poster3 XB

CREATION EVOLUTION
14. 09. 2007
0 views

CREATION EVOLUTION

SUSA502
03. 09. 2007
0 views

SUSA502

cocotutor
10. 10. 2007
0 views

cocotutor

ch11
16. 11. 2007
0 views

ch11

CEM Agro Eng
23. 11. 2007
0 views

CEM Agro Eng

kompella hotnets slides
28. 09. 2007
0 views

kompella hotnets slides

desanker
03. 09. 2007
0 views

desanker

S4 Lavigne
03. 09. 2007
0 views

S4 Lavigne

ECOMM Yalta 2004
04. 10. 2007
0 views

ECOMM Yalta 2004

Stan Abram
12. 10. 2007
0 views

Stan Abram

systheory ecopersp
19. 02. 2008
0 views

systheory ecopersp

crime 1
24. 02. 2008
0 views

crime 1

PierPaoloPasolini
24. 02. 2008
0 views

PierPaoloPasolini

RailShipments
28. 02. 2008
0 views

RailShipments

future truck
29. 02. 2008
0 views

future truck

9 13 07
27. 11. 2007
0 views

9 13 07

goodpracticehei pl
18. 03. 2008
0 views

goodpracticehei pl

eCp 2007 WP GI Prague
21. 03. 2008
0 views

eCp 2007 WP GI Prague

Alien Land Laws and Internment
26. 03. 2008
0 views

Alien Land Laws and Internment

20080311104620774
27. 03. 2008
0 views

20080311104620774

02 EnergyCirculation
07. 04. 2008
0 views

02 EnergyCirculation

Cuando El Viento Sopla 2115
21. 06. 2007
0 views

Cuando El Viento Sopla 2115

Cosas de Gatos 1850
21. 06. 2007
0 views

Cosas de Gatos 1850

Casas Diferentes 1966
21. 06. 2007
0 views

Casas Diferentes 1966

Carta de Navidad 1875
21. 06. 2007
0 views

Carta de Navidad 1875

Carta a los Reyes Magos 1870
21. 06. 2007
0 views

Carta a los Reyes Magos 1870

Barbies 2108
21. 06. 2007
0 views

Barbies 2108

A las puertas de la Navidad 1873
21. 06. 2007
0 views

A las puertas de la Navidad 1873

Amiga 1969
21. 06. 2007
0 views

Amiga 1969

Acertijo 2090
21. 06. 2007
0 views

Acertijo 2090

cb
07. 10. 2007
0 views

cb

emotion 07
20. 02. 2008
0 views

emotion 07

custintermang
28. 03. 2008
0 views

custintermang

CLSAInvestorMeetNov2 006
30. 03. 2008
0 views

CLSAInvestorMeetNov2 006

Piesman
24. 11. 2007
0 views

Piesman

Keynes Fiscal
09. 04. 2008
0 views

Keynes Fiscal

Utah0303
10. 04. 2008
0 views

Utah0303

williams
13. 04. 2008
0 views

williams

trendswrshprevised2
14. 04. 2008
0 views

trendswrshprevised2

LaTeX 5
14. 09. 2007
0 views

LaTeX 5

Oral Health Kindergarten
14. 09. 2007
0 views

Oral Health Kindergarten

MakingDx SN
04. 01. 2008
0 views

MakingDx SN

gfish2002
14. 09. 2007
0 views

gfish2002

Binaries3
28. 11. 2007
0 views

Binaries3

All Presenters
19. 06. 2007
0 views

All Presenters

wri idb draft2
19. 06. 2007
0 views

wri idb draft2

4Design methodology
29. 12. 2007
0 views

4Design methodology

Arriba el animo 2033
21. 06. 2007
0 views

Arriba el animo 2033

tronning
09. 10. 2007
0 views

tronning

Bahrain 2107
21. 06. 2007
0 views

Bahrain 2107

A Veces 1928
21. 06. 2007
0 views

A Veces 1928

Conejos a 50 pesos 2114
21. 06. 2007
0 views

Conejos a 50 pesos 2114

Blanca Navidad 1874
21. 06. 2007
0 views

Blanca Navidad 1874

Esther
14. 09. 2007
0 views

Esther

Acuarelas 1930
21. 06. 2007
0 views

Acuarelas 1930

Adan y Eva 1968
21. 06. 2007
0 views

Adan y Eva 1968

CTS
03. 09. 2007
0 views

CTS

TriTops
02. 01. 2008
0 views

TriTops

Ciudad de Mexico 1973
21. 06. 2007
0 views

Ciudad de Mexico 1973

El Negro Huerta 2038
21. 06. 2007
0 views

El Negro Huerta 2038

Abrazo 1929
21. 06. 2007
0 views

Abrazo 1929

Concurso de coches 2113
21. 06. 2007
0 views

Concurso de coches 2113

07 VC ChromakeyTemplate
11. 10. 2007
0 views

07 VC ChromakeyTemplate

Turkey map
26. 11. 2007
0 views

Turkey map

riverfront training
28. 12. 2007
0 views

riverfront training

canned searches
03. 10. 2007
0 views

canned searches

Christian Bale 1781
21. 06. 2007
0 views

Christian Bale 1781

revitalizing iuds
03. 09. 2007
0 views

revitalizing iuds

revitalizing iuds condensed
03. 09. 2007
0 views

revitalizing iuds condensed

LOC Feb99
14. 09. 2007
0 views

LOC Feb99

bertwashington
19. 06. 2007
0 views

bertwashington

HomelandSecurityPanel
04. 03. 2008
0 views

HomelandSecurityPanel

Casa de botellas 2044
21. 06. 2007
0 views

Casa de botellas 2044