-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement: Create new message handler for inbound/outbound messages to support RabbitMQ/others #88
Comments
Good that you mention this. I've already developed modules that communicate with Apache ActiveMQ Artemis like this. The problem is that OpenAS2 isn't quite ready for this, so the solution is a bit hacky. But we're planning to put in into production. One day, soon. |
@jsmucr Please feel free to suggest how OpenAS2 can be adapted to make it easier to create a message queue module @justanu You can follow the suggestions on how to add the inbound and outbound handlers as discussed here: https://sourceforge.net/p/openas2/discussion/265567/thread/75b5def5/ Similarly for outbound messages implement a class that replaces org.openas2.processor.receiver.AS2DirectoryPollingModule for receiving messages to be sent via AS2 from the message queue You should be able to copy the 2 classes listed above and then replace the relevant code in the class with code that reads/writes message queues. |
@uhurusurfa will follow the instructions and update the ticket. Thanks everyone. |
@uhurusurfa Sure. I didn't mean to be rude. I appreciate the software very much and will gladly help with its development (however my boss allows me to :-)). This is an example of my code (Groovy). There's a nasty thing I had to use to be able to create an
|
Is there a way to easily debug the server? |
Try adding the server itself as a Maven dependency to your module. The only downside is that the latest version available there is OpenAS2 2.4.1. |
I would suggest your first step should be a unit test but you can use the unit test that does a full system test(/src/test/java/org/openas2/app/OpenAS2ServerTest.java) and run it in debug mode in your IDE. |
I got the inbound working nicely:
Header: Will work on outbound as well. |
Got the outbound working as well, however there are few other things to consider, the retry and the MDN. So far here is an outbound configuration module: The interval is irrelevant since whenever the module starts, it listen to the messages on the AMQP queue. This is good since it actions immedialtely on receving of the message. The MQ message must have AS2-From and AS2-To set to match the AS2 ides as defined on the partnership.xml configuration file. I still need to see how I can replace the "errorDir" with a different mechanism, and probably create a retry module from queue instead of file system. |
Changed it slightly as following: INBOUND OUTBOUND The interval and errordir are not used. Will build test cases and provide the code |
Make sure you test with the latest version in the "dev" branch. There are significant changes to the base code for handling HTTP transport as well as fixes for resend functionality but no change to the module interface API so it should work the same |
@justanu Have you managed to complete this feature to include in the next release? |
@justanu Are you still going to provide the solution back to the project or shall I close this issue? |
If there is no progress I'll pick up on this. |
I'm picking up on this. After some work, I'll have to do some refactoring and code reorganization of the packages. Is that possible? |
Basically, I want to extract the DirectoryPollingModule.java Interface and relocate it into its own package to simplify the creation of similar extensions as external libraries to the project. |
I am prpbably missing something but not sure what exactly you want to do in terms of refactoring. ie. You simply extend MessageBuilderModule Any module you plug in would then pass files it has to the AS2SenderModule via the MessageBuilder implementation. |
@igwtech @justanu @uhurusurfa @jsmucr Somewhat related to this topic, are you aware of an existing module that allows |
Not sure what your use case is but I am not sure why you want OpenAS2 to do. However, it is unclear why you would not simply run OpenAS2 on a server that is the ultimate destination of the file since OpenAS2 is in effect an FTP server with added features for security. |
@uhurusurfa Thanks very much for your feedback. To your point below, that's what I'm going with. My use case is that I have an existing FTP server that runs on a different box that OpenAS2, but I'm just going to spin up FTP on the same box that I run OpenAS2 on. However, it is unclear why you would not simply run OpenAS2 on a server that is the ultimate destination of the file since OpenAS2 is in effect an FTP server with added features for security. |
This is a new feature not a bug.
I would like to create a new handler for both inbound and outbound messages:
There will be two queues created, one for inbound, another for outbound. The MQ message will contain sender and receiver (eg AS2 identifier) at the header level.
I would need in config.xml to be able to specify the implementation handler for both inbound and outbound message.
I am willing to work on it once I get the workspace setup.
The text was updated successfully, but these errors were encountered: