Setting up an LCDS Edge server can sometimes seem a bit daunting but there really isn’t all that much to it
To illustrate this point, I’ll show you how to setup the lcds-samples web application from one LCDS 3.1 turnkey installation to act as the Edge server to another lcds-samples web application from a second LCDS 3.1 turnkey installation. The great thing about this example is that you won’t need to recompile any Flex applications to see this working!
To make things easier you will need two machines. One to run each Tomcat server from the two turnkey installations. I used my laptop and a VMWare instance for this. This is so you don’t need to waste time configuring everything to avoid port conflicts and in the real world the two servers would be on separate machines anyway.
Install LCDS 3.1 on your two test machines now using the installer for your platform. I used Windows.
The setup for the app tier server is the simplest so let’s do that one first. Find the services-config.xml file for the lcds-samples webapp on one machine and open it up for edit. On my app tier machine, I installed LCDS to C:\lcds31_app so my services-config.xml can be found at C:\lcds31_app\tomcat\webapps\lcds-samples\WEB-INF\flex\services-config.xml.
In the channels section add the following channel definition for the gateway endpoint. This is what the Edge server will talk to on the backend.
<channel-definition id="gateway-endpoint" server-only="true"> <endpoint url="amfsocket://localhost:9807"/> </channel-definition>
Um, so that’s it for the app tier. You can start the database server and the Tomcat server on this machine now. We’re also going to use the TraderDesktop sample for this demo so you can go ahead and start the TraderDesktop ticker feed by requesting the following URL in a browser (assuming you’re on the local server).
Now for the Edge server. Find the services-config.xml file for the lcds-samples webapp on your other machine and open it up for edit. On my Edge server machine, I installed LCDS to C:\lcds31_edge so my services-config.xml can be found at C:\lcds31_edge\tomcat\webapps\lcds-samples\WEB-INF\flex\services-config.xml.
There is a bunch of stuff here we don’t need so let’s comment it out. All the destinations we want to talk to are in the app tier so we don’t need any destinations defined at the Edge. We also don’t need any services except the gateway service which we will be adding in a second.
Comment out the following lines in the services-config.xml.
<service id="hsqldb"></service> <service-include file-path="remoting-config.xml" /> <service-include file-path="proxy-config.xml" /> <service-include file-path="messaging-config.xml" /> <service-include file-path="data-management-config.xml" /> <service id="runtime-employee-ds"></service> <service id="runtime-employee-ro"></service> <service id="model-deploy-service"/>
Now add the following gateway service definition to the services section of your services-config replacing your.app.tier.server with the ip address for the machine that is running your app tier server.
<service id="samples-gateway"> <properties> <gateway-endpoint> <require-for-startup>false</require-for-startup> <require-authentication>false</require-authentication> <urls> <url>amfsocket://your.app.tier.server:9807</url> </urls> </gateway-endpoint> </properties> </service>
Would you believe that that’s it for Edge server configuration? Well, it is! You can now start the Tomcat server on your Edge server machine.
All that’s left to do is run the TraderDesktop app on the Edge server. Open up a browser on the Edge server machine and request the following URL.
You should see the TraderDesktop application load and start receiving stock ticker updates from the LCDS server running in the application tier.
Pretty cool, huh?