is it possible configure a channel with two or more packager?

85 views
Skip to first unread message

Jaime Vizán González

unread,
Oct 2, 2009, 5:35:16 AM10/2/09
to jpos-...@googlegroups.com
Hi,

I have to get two kind of ISO message and both of them must be
processed. I have been reading JPosGuide about filter but I don´t
believe that it is the solution. is it necessary I develop a custom
channel?

Thanks in advance

Miscelanea

unread,
Oct 2, 2009, 6:18:05 AM10/2/09
to jPOS Users
I mean, is it possible configure a channel with one or more packager-
config property?

Mark Salter

unread,
Oct 2, 2009, 1:51:35 PM10/2/09
to jpos-...@googlegroups.com
Miscelanea wrote:
> I mean, is it possible configure a channel with one or more packager-
> config property?
Not as things stand.

You would also need to configure the selection trigger - for one
packager or the other.

Out of interest, how would you know which message type arrived - so you
could steer the packager choice


--
Mark

Jaime Vizán González

unread,
Oct 2, 2009, 5:31:59 PM10/2/09
to jpos-...@googlegroups.com
The two kinds of messages have the same header but their body is
completely different. Inside the header, the type of message is
informed in a concrete bit. Is it possible to make a ISOMsg in two
steps? First, I could read the header with a heading packager. When i
have the type bit I could read the body with the appropriate packager.

Alejandro Revilla

unread,
Oct 2, 2009, 5:58:19 PM10/2/09
to jpos-...@googlegroups.com
Please have a look at BaseChannel's getDynamicPackager method.

You can create a channel that could override that method and figure out what packager to use depending on the message content.

Hope that helps.


Jaime Vizán González

unread,
Oct 3, 2009, 10:26:01 AM10/3/09
to jpos-...@googlegroups.com
Hi, Alejandro. I have created a new channel which extends ASCIIChannel
and I have redefined the getDynamicPackager (byte[] image) method but
I have found a new problem, in the image argument isn´t the header.
Only, in the image argument is the body.

Alejandro Revilla

unread,
Oct 3, 2009, 11:31:41 AM10/3/09
to jpos-...@googlegroups.com
Good point. I think we need to change the signature of getDynamicPackager(byte[] image) to something like
getDynamicPackager(byte[] header, byte[] image).

Would that work for you?

2009/10/3 Jaime Vizán González <jaime...@gmail.com>

apr

unread,
Oct 3, 2009, 1:00:18 PM10/3/09
to jPOS Users
Jaime,

I went ahead and added a protected ISOPackager getDynamicPackager
(byte[] header, byte[] image) in r2791.

Hope this helps.

Are you using jPOS or jPOS-EE?

If you're using jPOS-EE just let me know and I can update the modules/
jpos/lib/jpos.jar with the new version, otherwise I'll wait for more
changes.

Jaime Vizán González

unread,
Oct 4, 2009, 6:12:55 AM10/4/09
to jpos-...@googlegroups.com
Ok, Im using JPOs.
Thanks

Mark Salter

unread,
Oct 4, 2009, 7:30:28 AM10/4/09
to jpos-...@googlegroups.com
Jaime Vizán González wrote:
> Ok, Im using JPOs.
Ok, so Alejandro's change should really help you get to your goal.

I have (just - r2793) committed a small change to ensure the receive
method uses the new getDynamicPackager(header, image) method. The base
implementation of which calls the previous version to provide backward
compatibility.


--
Mark

Alejandro Revilla

unread,
Oct 4, 2009, 10:20:33 AM10/4/09
to jpos-...@googlegroups.com
Hey Mark, thank you for r2793, I neglected to add the most important part of the patch!
Reply all
Reply to author
Forward
0 new messages