Posting.idl:
// The #pragma is specific to OpenDDS
#pragma DCPS_DATA_TYPE "Posting"
struct Posting {
string subject;
string body;
string author;
};
You will use the mwc.pl Perl script on an MPC file
(e.g., Posting.mpc) that will the Posting.idl
file to generate the needed support code and makefiles for the
publisher and subscriber executables. This script
is located in $ACE_ROOT/bin. For Linux, the command line
might look something like this: $ $ACE_ROOT/bin/mwc.pl
-type gnuace For Visual Studio 2005, the command line
might look something like this: C:\> %ACE_ROOT%\bin\mwc.pl
-type vc8
The makefiles or solution files should then be ready for you to use.
The publisher application executable (whose source code you must
write) will create/delete newgroups topics and send out postings based
on the Posting IDL shown above. The subscriber
application (whose source code you also must write) will then output
the newsgroup topics and postings when they are received.
When the subscriber starts up, it will use the DDS built-in topic feature to wait for the creation/deletion of newsgroup topics and receive the postings when when arrive (e.g., display them to the screen). In particular, you will need to create a subscriber application that will
If anything fails to work properly the subscriber main function should simply print out the appropriate exception and exit with a return status of 1. If everything works correctly, the program should exit with a return status of 0.
Posting.mpc and Posting.idl files to
generate the needed support code and makefiles.When the publisher starts up, it will create newsgroup topics, send postings (e.g., 10 postings per newsgroup), and then delete the topic. In particular, you will need to write a publisher application that
Posting data type,
Posting objects,
Posting data fields as desired,
If anything fails to work properly the publisher should simply print out the appropriate exception and exit with a return status of 1. If everything works correctly, the program should exit with a return status of 0.
Also, the order in which the executables are invoked in important. The Info Repository needs to be launched first, then the subscriber, then the publisher.
The Info Repository should be launched as follows:
$DDS_ROOT/dds/InfoRepo/DCPSInfoRepo -ORBSvcConf tcp.conf -o repo.ior -d domain_ids
where DDS_ROOT is equivalent to $ACE_wrappers/TAO/DDS.It also needs to be manually killed when the DDS application is done running. There will be a file named repo.ior left in the directory. It is a good idea to delete this file to avoid any confusion for succeeding invocations (although there may be no harm in leaving it alone).
Example output for the Info Repository:
$ $DDS_ROOT/dds/InfoRepo/DCPSInfoRepo -ORBSvcConf tcp.conf -o repo.ior -d domain_ids
(12588|3078248128) 13:55:01.262144 Repo main
(12588|3078248128)INFO: not using file configuration - no configuration file specified.
Example output for the supplier:
$ ./subscriber -ORBSvcConf tcp.conf -DCPSConfigFile sub.ini Example output for the publisher:
$ ./publisher -ORBSvcConf tcp.conf -DCPSConfigFile pub.ini (20553|3086640832) Writer::start (20553|3027631024) Writer::svc begins. 13:55:31.995447 (20553|3027631024) Writer::svc starting to write. (20553|3027631024) Writer::svc finished. (20553|3086640832) Writer::end
Learning and Using DDS
You will be using the OpenDDS Data Distribution Service (DDS) implementation. Please reference the documentation there for downloading and setting up OpenDDS.You will also need to download and install ACE and TAO. Please see the online documentation for information on how to setup your ACE and TAO development environment on EECS's computing system.
NOTE: There is also an example OpenDDS application in the OpenDDS distribution under $DDS_ROOT/DevGuideExamples/DCPS/Messenger. This example should be helpful if you're stuck on what OpenDDS calls to make in your code.
Concluding Remarks
This DDS assignment should fairly straightforward, though it illustrates the basic skills required to become adept at using DDS publish/subscribe middleware to developed distributed applications. Subsequent assignments will build on this assignment, so make sure you get it working correctly.
Back to CS 395-2 home page.