Hi,
I haven't been updating you for a long time - I had really busy semester at my university. Happily I've passed all the exams and now it's good moment to continue working on what I picked some time ago, which is Erlang binding.

I've created some base code which can be found under sandbox/wjaniszewski. It implements:
1. Reference side - passing messages to Erlang nodes
2. Reference side - RPC
3. Service side - RPC

This code is dirty and needs much attention - especially for handling non standard situations. However it's already good enough to show intention and used mappings between Java and Erlang:

Rule 1. Each reference binding may be configured to communicate using Erlang messaging system. Following reference can be only used to send messages to node "MboxServer". Node can operate many message boxes, so target message box name will be taken from method executed in referenced object.

<reference name="mboxReference">
        <tuscany:binding.erlang node="MboxServer" mbox="true"/>
</reference>

Rule 2. Each reference binding may be configured to be a RPC client to certain program module (which is hosted on Erlang node and one Erlang node may host many modules). Following reference can be only used to execute functions declared in "hello" module on "RPCServer" node. Module can contain many functions so target name will be taken from method executed in referenced object. To access different modules separate references should be created.

<reference name="moduleReference">
        <tuscany:binding.erlang node="RPCServer" module="hello"/>
</reference>

Rule 3. Each service may be configured to be RPC server. If so then it acts as program module on node - it's similar to rule 2, but reversed.

<service name="ServiceTest" promote="ServiceTest">
  <interface.java interface="...ServiceTestComponent" />
    <tuscany:binding.erlang node="RPCServer" module="hello"/>
</service>

Sample uses of this binding can be found in JUnit tests in binding-erlang-runtime module.

I also have/had some problems, which are infrastructure related:

Problem 1. Erlang binding uses official jinterface library which I didn't found in official maven repositories. It can be added locally to maven repository, but it obviously breaks automation of building project. What is your experience for such case?

Problem 2. Testing- Erlang uses Erlang Port Mapper Demon (epmd) to register nodes etc. Epmd is standalone, non-java program and Erlang binding tests needs it to be launched - it also can break automation of building and testing project. I don't feel like rewriting it in Java ;) Also having native Erlang nodes would be the best (not emulating them by jinterface) and to do that we need to execute native erl binary. Any thoughts?

I'll greatly appreciate any comments.

Thanks,
Wojtek

Reply via email to