phax / as2-lib

A generic Java AS2 library, servlet and server
107 stars 43 forks source link

getting started #128

Closed joris77 closed 2 years ago

joris77 commented 2 years ago

Hi,

I read a large part of the documentation, but I do not see a getting started anywhere. I am able to run the spring boot demo locally, but miss a pointer on how to send a valid message there from my local machine.

Tnx in advance,

Joris Wijlens

joris77 commented 2 years ago

I started working with the as2 server, that is also an option

phax commented 2 years ago

Hi @joris77

For sending I recommend you look into the code for sending to the Mendelson test server: https://github.com/phax/as2-lib/blob/master/as2-lib/src/test/java/com/helger/as2lib/supplementary/main/MainSendToMendelsonTestServer.java

For receiving you need to make a basic design decision: a) do you want to have a standlone, socket based server - then use as2-server module or b) if you want something in an application server like Tomcat - then use as2-servlet as a library to build your own application or use the Spring Boot example - both are configured via the configration file, usually found in config/config.xml

joris77 commented 2 years ago

But i see now that if I use as2-server that it does not have a dependency to as2-lib? Is all the code duplicated there?

phax commented 2 years ago

If you are referring to https://github.com/phax/as2-lib/tree/master/as2-server - then it includes as2-lib. If you are referring to a different as2-server: I don't know ;-)

joris77 commented 2 years ago

I mean the first indeed :) What do you mean by included? I guess when I start with that with my project I cannot upgrade versions by just changing a version in the pom right?

phax commented 2 years ago

The pom.xml (Maven build file) includes as2-lib as a dependency. So the as2-lib code is used "as is" - and the versions of those 2 should always be the same.

See above: as2-server is a pure Socket-based server. What kind of project do you want to build?

joris77 commented 2 years ago

Ah I am very sorry missed indeed that dependency ... stupid :(

I will probably build a couple of connections receiving and sending ideally in their own separate repos. The receivers will run as docker container and will write to an aws s3 bucket after receiving a message. Senders ideally run as AWS lambdas and are triggered by SQS queues. For me lightweight and as simple as possible are my main concerns :)

phax commented 2 years ago

Yes okay got it. Than the "MainSendToMendelsonTestServer" is a good starting point. Key programming action will be to get the certificates from a secure store as I assume they will not be lying around as P12 or JKS files. The rest can easily be customized.

For the receiver part use Spring Boot as the basis. There, the CertificateFactory (see config.xml) also needs to be adopted to read the JKS/P12 data from an alternate stream.

hth

joris77 commented 2 years ago

Thank you so much for your fast responses ... appreciated. I will start doing that and see if I can get something basic up and running on my local machine.