QServer+QMUX - > to send the request from server to client ?

3,139 views
Skip to first unread message

pugazhendhi t

unread,
Jun 10, 2013, 9:27:14 AM6/10/13
to jpos-...@googlegroups.com

can anyone help me in doing this ... ?

i tried in lot of way, but its of no use does anyone have samples for this anywhere  ?

Thanks
t.Pugazhendhi

Mark Salter

unread,
Jun 10, 2013, 12:58:26 PM6/10/13
to jpos-...@googlegroups.com
Please stop opening new threads on this same problem.

On 10/06/2013 14:27, pugazhendhi t wrote:
>
> can anyone help me in doing this ... ?
There are outstanding questions (to you) on the existing threads, please
answer those questions first.

Your questions and their lack of 'smartness' is not helping you achieve
what is a very simple thing using jPOS-ee.

The lack of information in your 'un-smart' questions is not helping...

... sorry to be so blunt.

>
> i tried in lot of way, but its of no use
You appear to be trying random things and not listening to advise or
providing the detail needed to help.

> does anyone have samples for
> this anywhere ?
The detail you need is already available - in documentation/mailing
list/search/engine, but you have missed it or failed to follow it.

Chasing an answer for free just isn't going to help either.

Have a careful read through the link about smart questions I have shared
with you at least once and then spend some time checking you have
answered the questions poised to you (answer them just once though as
some have been asked more than once), or....

... just try and ask a single smart question on this new thread if you
find that will be easier for us all.


--
Mark

chhil

unread,
Jun 10, 2013, 2:36:53 PM6/10/13
to jpos-...@googlegroups.com
This is working code. If you can get it to work , excellent, if not there is nothing else I can do to help here.
This code basically uses the mux configured in the server to send a message to a client connected to it. I used netcat as a client that connected to port 23000.
The mux request sends the message to the client and its visible in the client
http://screencast.com/t/V0zEZSXA

Its unfortunate that you need so much of spoon feeding. All this has been covered an explained in the threads.

I have used jpos 1.8.7 and java 7 for running this.

////////////////////
//Server Deploy File

<!--File Name 10_server.xml -->
<?xml version="1.0" ?>
<server name="server-1" class="org.jpos.q2.iso.QServer" logger="Q2">
  <attr name="port" type="java.lang.Integer">8888</attr>
  <channel name="channel.1"
          class="org.jpos.iso.channel.NACChannel"
          packager="org.jpos.iso.packager.GenericPackager" logger="Q2">
     <property name="packager-config" value="cfg/iso87ascii.xml" />
     </channel>
  <request-listener class="a.b.MyRequestListener" logger="Q2" realm="incoming-request-listener">
  
  
  </request-listener>
 <in>NETWORK_IN</in>
 <out>NETWORK_OUT</out>
 
</server>


////////////////////
<!--File name : 20_qserver_mux.xml-->
<?xml version="1.0" ?>
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="qserver-mux">
 <in>NETWORK_OUT</in>
 <out>NETWORK_IN</out>
 <key>11</key>
 <unhandled>unhandled</unhandled>
</mux>

---------------------
<!-- Bean deploy file, file name 52_sendmessage.xml-->

<test class="a.b.SendTestMessage" logger="Q2">
 
 
</test>
------------------------
//Bean to send message, make sure you have a client like netcat running and listening on port //23000
//Filename :SendTestMessage.java
package a.b;

import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOServer;
import org.jpos.q2.QBeanSupport;
import org.jpos.q2.iso.QMUX;
import org.jpos.util.NameRegistrar;

public class SendTestMessage extends QBeanSupport {

    private ISOServer isoServer;

    @Override
    protected void startService() throws Exception {

        QMUX qmux = (QMUX) NameRegistrar.getIfExists("mux.qserver-mux");
        isoServer = ISOServer.getServer("server-1");
        if (isoServer.getConnections() > 0 && qmux != null) {
            try {

                if (qmux.isConnected()) {
                    ISOMsg m = new ISOMsg();
                    m.setMTI("0100");
                    m.set(2, "123456789012345");
                    m.set(11, "901234"); // 11 needs to be there else it wont get sent,
// I have configured it as the mux key
                    m.set(41, "12345678");// As they are used as a default key by mux
                    qmux.request(m,5000);

                }

            }
            catch (ISOException e) {

            }
        }
    }

}
-------------------------
// RequestListener defined in Server but never used right now.
package a.b;

import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISORequestListener;
import org.jpos.iso.ISOSource;

public class MyRequestListener implements ISORequestListener {

    @Override
    public boolean process(ISOSource source, ISOMsg m) {


        return false;
    }

}
--------------------------------
Best of luck.

-chhil


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage.
Please support jPOS, contact: sa...@jpos.org

You received this message because you are subscribed to the  "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users

---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



chhil

unread,
Jun 10, 2013, 2:52:07 PM6/10/13
to jpos-...@googlegroups.com
Change the port to 23000 in the server deploy.
  <attr name="port" type="java.lang.Integer">23000</attr>

Pugazhendhi T

unread,
Jun 11, 2013, 3:15:35 AM6/11/13
to jpos-...@googlegroups.com
thanks for your help.

if any client connects  whether its automatically sends the message ?

52_sendmessage.xml
<test class="SendTestMessage" logger="Q2">
</test>

chhil

unread,
Jun 11, 2013, 4:11:16 AM6/11/13
to jpos-...@googlegroups.com
 
The code is to show you how a server initiates a request through the qmux.

"if any client connects  whether its automatically sends the message ?"
Figure it out by debugging (put a breakpoint in startservice method) and tell us the behavior.

Its working code and you have the source, so at a minimum please try and figure it out. The important thing to remember here is that the qmux sends the message, this is what you have been struggling for over a week.

-chhil
p.s.
I simply am adding this to avoid more questions from you :(

You can write a client deploy file that connects to this server. Make sure deploy file name has a number less than 52, so that it gets deployed and connected prior to
52_sendmessage.xml being deployed. Once 52_sendmessage.xml is deployed it calls the beans initservice and startserrvice. Startservice , checks for the mux and connections and sends the message.


Message has been deleted

Pugazhendhi T

unread,
Jun 11, 2013, 5:33:27 AM6/11/13
to jpos-...@googlegroups.com
thanks your solution working ....


On Tue, Jun 11, 2013 at 2:52 PM, pugazhendhi t <pugazhe...@gmail.com> wrote:
many Thanks  your solution working , But i have one issue ?

 If i add debug point  in (SendTestMessage.java)  then only its sending the message to client , otherwise its not sending , if i run my project without debug point?   

I created two Net beans  project, like

ServerSimulator (project 1)
------------------------------------

Deploy
   --  10_server
   --  20_qserver_mux
   --  52_sendmessage

Src
  -- MyRequestListener.java
  -- SendTestMessage.java
  -- startup.java

ClientSimulator (project 2)
-----------------------------------

Deploy

    --  23_clientsimulator_channel
    --  20_clientsimulator_mux

Src
      --  ISOListener.java
      -- TestStartup.java


To run my project i used the following code.

----------  Startup.java-------------

import org.jpos.q2.Q2;

public class startup {
    public static void main(String[] args){
            Q2 q2 = new Q2 ();
            q2.run();
    }
}

-----------------------------------------


is this correct way  ?

Really thanks for you , i know i am disturbing u like anything . but i am really sorry for that .. and thanks a lot ...

chhil

unread,
Jun 11, 2013, 5:55:26 AM6/11/13
to jpos-...@googlegroups.com

Run everything from one project. When you do this it means you are running it in "one jvm".



Deploy
   --  10_server
   --  20_qserver_mux
   --  52_sendmessage
   --  23_clientsimulator_channel
   --  20_clientsimulator_mux

Src
  -- MyRequestListener.java
  -- SendTestMessage.java
  -- startup.java
  --  ISOListener.java
  -- TestStartup.java

You start the serversim and by the time you start the clientsim the
sendmessage bean has called its startservice and message does not get sent as connection is not available.
Maybe if you shifted the breakpoint to the mux.request and you would have seen it does not get called. But you were not told to do it so you mustn't have done it :).

It works with a breakpoint because the client connects by the time your breakpoint is hit.

If you have all the files in one proj, q2 loads the files in order and your message sending will work.



"is this correct way  ? "
It works for you so it is correct.
 
Is it appropriate?
We dont run projects like this, read up the programmers manual and other free pdfs available on how jpos projects get built and executed.

-chhil

chhil

unread,
Jun 11, 2013, 5:59:30 AM6/11/13
to jpos-...@googlegroups.com
In a day or 2 you can tell us why your now famous acquirer|Network|Issuer solution was not working and what you did to get it working.
Take your time and try figuring it out without external help.

-chhil

Pugazhendhi T

unread,
Jun 11, 2013, 6:01:32 AM6/11/13
to jpos-...@googlegroups.com
Once again thanks a lot . so my understanding is , i should have only one project ?

With one Deploy folder with all my Servers and  Clients.

To do this  Objective : 

| Server |  Acquirer  | Client |  ----->  | A- Server | Network -Switch | B- Server |  -----> | Client | Issuer |


Why we are naming with numbers   like  52  ,  20 in deploy folder for files ..
52_sendmessage.xml
20_qserver_mux.xml


Thanks
T.Pugazhendhi

chhil

unread,
Jun 11, 2013, 6:03:47 AM6/11/13
to jpos-...@googlegroups.com
STFG

pugazhendhi t

unread,
Jun 11, 2013, 7:41:49 AM6/11/13
to jpos-...@googlegroups.com

Suggestion Needed ?

From A-Server using MUX of B-Server sent msg to issuer.

 issuer gave response back , recieved in B-Server ISOListener.

Now i want to send this recieved response to Acquirer as response  ? To do that whether i can get the Source Address from Space to send it to acquirer ?  so that i can call Source.send(response)   (OR ) whether again i need to add mux in Server -A also ?



chhil

unread,
Jun 11, 2013, 9:53:05 AM6/11/13
to jpos-...@googlegroups.com
If you designed it correctly the mux that sent the request would have received the response.

[ api used: public ISOMsg request (ISOMsg m, long timeout)]
You can take the returned response and send it using the source thats available.

If your mux did not receive the response, revisit the "few" threads you have  started, its covered in one or more of them.

My suggestion is to take a break from coding for a few days. Spend the time learning the basics and how the components work and how they can be used together, then venture into coding a solution. Your current code can be considered a POC, in no way think of it as a release worthy solution.
 
At the rate you are going people will stop responding.
Each post gets ditributed to 1000+ group members who I am pretty sure are unhappy getting spammed. Please take this advice seriously and not ignore it like the other requests made in earlier posts.

Please think long before hitting the reply button to this email.

-chhil


Mark Salter

unread,
Jun 11, 2013, 10:00:40 AM6/11/13
to jpos-...@googlegroups.com

On Tuesday, June 11, 2013 12:41:49 PM UTC+1, pugazhendhi t wrote:

Suggestion Needed ?
I have to think that Chhil's suggest is the one you should really take...


From A-Server using MUX of B-Server sent msg to issuer.



Your A-Server.RequestListener.process(ISOSource source, ISOMsg m)

has an ISOSource passed into it, that will be the place to send your response, but the need for your ISORequestListener is debatable, you could organise a queue to save the context and the ISOSource, but for this test setup, consider dropping the B-Server RequestListener - unless you need or want it?

--
Mark

Mark Salter

unread,
Jun 11, 2013, 2:37:35 PM6/11/13
to jpos-...@googlegroups.com
On 11/06/2013 11:01, Pugazhendhi T wrote:
> Why we are naming with numbers like 52 , 20 in deploy folder for
> files ..
> 52_sendmessage.xml
> 20_qserver_mux.xml

Please search first and then ask if you cannot find it?

This *exact* question was asked and answered many times and most
recently less than 3 weeks ago.

--
Mark

QSwitch

unread,
Jun 12, 2013, 9:19:45 PM6/12/13
to jpos-...@googlegroups.com
Hi chhil,

I understand your code, however I am curious, by using your code below:

QMUX qmux = (QMUX) NameRegistrar.getIfExists("mux.qserver-mux");

If I have multiple client connected to my server, how to get the MUX of specific client ? Let say I have multiple ATM connected to my server, and I want to send a "Set Out of Service" to certain group of ATM only, how to do that ?

Regards,
QSwitch

chhil

unread,
Jun 13, 2013, 2:32:32 AM6/13/13
to jpos-...@googlegroups.com
Your query sounded familiar and led me back to your thread :)

https://groups.google.com/forum/?fromgroups#!searchin/jpos-users/qmuxes$20on$20the$20fly

Bear with me here, I am thinking out aloud here and opening a brainstorming session to come to a solution. I havent tried tried this myself as I have not felt the need for it yet. Hoping some of the group members pitch in to solve this.

Lets start with 2 ATMs connecting.

Assuming each atm client connecting has a unique IP (alternative is they connect to a hardware box and connect to you from a single IP with different local port numbers).

This is not scalable if you manage 1000's of atms, thats something we can think about a little later :).

Update qserver code to handle reading in multiple <in> and <out> queues.  Name them based on unique IP addresses in the qserver deploy file. You could use terminal ids too. (terminal ids would map to uniquie IP or IP:localPort).

Have the same number of mux files using these queue names and mux name would be their IP addresses.

Modify the notify method in the qserver to get the channel name based on the key passed in (I assume this will be the queue name that we configured (IP address) and use that channel to send the unsolicited request message.

-chhil




QSwitch

unread,
Jun 13, 2013, 4:23:43 AM6/13/13
to jpos-...@googlegroups.com, pugazhe...@gmail.com
Hi Chhil,

Yes, almost similar question has been asked few months back, although I have a workaround in place, honestly I am still not satisfied and still looking more elegant approach.

In my case, ATM connect directly to my server on a single port. I identify the ATM by it's source IP Address, so your suggestion to have multiple mux with queue name based on the ATM's IP Address sounds practical.

I can imagine creating one mux bean per ATM with <in> and <out> queue name based on unique IP Address, however, how to make QServer listening on a single port (single bean descriptor) reading multiple queue ? Looks like I have to derive QServer Class and override some of it's method ?

Thanks & Regards,
QSwitch

On Monday, 10 June 2013 20:27:14 UTC+7, pugazhendhi t wrote:

chhil

unread,
Jun 13, 2013, 4:37:14 AM6/13/13
to jpos-...@googlegroups.com, pugazhe...@gmail.com
"Looks like I have to derive QServer Class and override some of it's method ?"
"Update qserver code to handle reading in multiple <in> and <out> queues."
See how the single in/out are handled and update its handling to mimic how the multiple ISORequestlistener elements get handled.
You could extend QServer or update it and maybe contribute your code back to jpos. I do think this feature is definitely a good to have.

-chhil


--

QSwitch

unread,
Jun 13, 2013, 4:50:18 AM6/13/13
to jpos-...@googlegroups.com, pugazhe...@gmail.com
Thanks for your advise, I'll spare some time for this and sure I'll share it to the community.

Regards,
QSwitch

chhil

unread,
Jun 13, 2013, 8:03:04 AM6/13/13
to jpos-...@googlegroups.com
Just wanted to inform you guys that the qmux.isConnected() check is rather redundant/misleading in the code I had posted here as it always returns true since there is no channel ready handling when we deal with the server. Rely on the 
isoServer.getConnections() > 0 && qmux != null check.


    public boolean isConnected() {
        if (ready != null && ready.length > 0) {
            for (int i=0; i<ready.length; i++)
                if (sp.rdp (ready[i]) != null)
                    return true;
            return false;
        }
        else
            return true;
    }

-chhil

On Tue, Jun 11, 2013 at 12:06 AM, chhil <chi...@gmail.com> wrote:
qmux.isConnected()


Mark Salter

unread,
Jun 16, 2013, 1:58:26 PM6/16/13
to jpos-...@googlegroups.com
On 13/06/2013 09:23, QSwitch wrote:
> I can imagine creating one mux bean per ATM with <in> and <out> queue
> name based on unique IP Address, however, how to make QServer listening
> on a single port (single bean descriptor) reading multiple queue ? Looks
> like I have to derive QServer Class and override some of it's method ?
How about using a TransactionManager instance to conduct this decision
and routing, rather than doing so in the server??

--
Mark

chhil

unread,
Jun 17, 2013, 6:21:54 AM6/17/13
to jpos-...@googlegroups.com

In order to set up sending of unsolicited commands the in/outs and muxes need to be setup so that you pick the mux by name and send the request. Being unsolicited there may not be a request from the atm in play for transaction manager to piggy back the unsolicited request on the connection.
An example would be, I change the state/screen flow or the encryption key for a group of atms and these need to be sent/downloaded to the atm. To do this I would end a close atm atm command followed by download.
This could best be achieved by a running bean outside the transaction manager participants.

Yes we could use a transaction manager but it seems an overkill (my perspective based on my understanding).
Have a transaction manager which gets triggered by putting a command on is queue to send a download and the participants (close atm, send states, send screens,send key, open atm) where each participant sends the requests to a list of atms. Alternately you could have a Transaction Manager per atm to do this. Irrespective of method some synchronization will be needed to make sure you dont interrupt the current atm transaction.
Eventually it boils down to requirements and design :).

-chhil

QSwitch

unread,
Jun 17, 2013, 9:28:02 AM6/17/13
to jpos-...@googlegroups.com, pugazhe...@gmail.com
Hi Mark,

IMHO, I don't think Transaction Manager can solve my problem. My main issue here is, how to synchronously send a message from QServer to a client (provided that there are multiple client connected to my QServer on a single port) and wait a response from those client. This is perfectly achieved by a QMUX, however the remaining issue for me now is, how to make QServer take multiple <in> and <out> queue as sugested by chhil.

Chhil,

You are right, my problem is only when I want to send a message from QServer to certain client and synchronously wait for a response. One of the case is when I want to download ATM's state/screen, first I need to ensure it is in "Out Of Service" state by sending a Terminal Command, and only after ATM said "OK", then I can proceed with the rest of sequences.

Regards,
QSwitch

Alejandro Revilla

unread,
Jun 17, 2013, 9:42:35 AM6/17/13
to jpos-...@googlegroups.com, pugazhe...@gmail.com
When you need to originate a message, how would you tell which channel connected to your QServer to use?
The last one? the first one? all of them?

If your client initiates the session by sending a sign-on message, then you can register the channel key (channel.toString()) somewhere in your application and use that key to send messages (QServer provides a getChannel(String)).


--
@apr


chhil

unread,
Jun 17, 2013, 11:35:23 AM6/17/13
to jpos-...@googlegroups.com
Alejandro,
The suggestion earlier is to use qmux names and in/out names of queues as IP addresses stings.
So when I want to send a message to atm x, I know its IP and call that mux to send the message. The qserver
need a modification to derive the channel name from the key name and get that channel to send the message.

-chhil

Alejandro Revilla

unread,
Jun 17, 2013, 11:43:19 AM6/17/13
to jpos-...@googlegroups.com
So when I want to send a message to atm x, I know its IP and call that mux to send the message. The qserver
need a modification to derive the channel name from the key name and get that channel to send the message.

Perhaps a variant of QServer.getChannel(String) that could accept a regexp ... problem is you may have some NAT related issues there where many ATMs could appear to come from the same IP. I prefer the high level logon approach ...

damien.grandemange

unread,
Jun 17, 2013, 1:10:44 PM6/17/13
to jpos-...@googlegroups.com, pugazhe...@gmail.com
Hi, long time no see.

Well, i may miss something but, can't it be solved doing this at the channel level ?
I agree this may not be the best place to deal with ATM business concerns (which i don't know much about to speak frankly).

Anyway, let's say you have a (ATM) client connected through this channel, so you got your channel instance that holds the client connection.
Let's say you also have one QBean dedicated to ATM management (or something like that) that keeps reference to those kind of channels, with some grouping fonctionality inside.
When a client (dis)connects through this channel, (un)registration is made to this particular QBean.
When you want your jPos server to send key to a group of remotely connected client ATMs, you could send a dedicated command to your QBean (specifying some ATM selection criteria).
When the QBean receives such command, it could send a notification to the set of registered channels which comply to those criteria.
Registered channels should be implemented to react to such notification. That implies it embeds the logic to engage further actions (initiate a conversation with ATM such as cchil described it...).
Those kind of channels could hold a state to indicate if they are currently busy (i.e. in a middle of  an incoming transaction processing) or idle, and react accordingly.
Actually, maybe the channel could hold its client ATM state (opened, closed, currently busy, ...) and implements the way it should react when receiving events on these states.
With such design, QServer implementation would remain unchanged.

chhil

unread,
Jun 18, 2013, 12:23:46 AM6/18/13
to jpos-...@googlegroups.com
The NAT releated issue sounds similar to all ATMs connecting to a single hardware box and all traffic appears to come from a single IP (usualy a case when they are dialup atms and box does a protocol conversion), in this case differentiating of atms needs to be done based on ip + local port being used for the connection.
Logons would work but ATMs, at least the ones i have worked with previously dont do logons.

-chhil
On Mon, Jun 17, 2013 at 9:13 PM, Alejandro Revilla <a...@jpos.org> wrote:
NAT related issues there where many ATMs could appear to come from the same IP. I prefer the high level logon approach ...


chhil

unread,
Jun 18, 2013, 1:18:12 AM6/18/13
to jpos-...@googlegroups.com
Welcome back Damien!

Will have to give this some thought and I dont see why it wouldn't work.
Though here are some questions that pop up.
If we use a channel, I assume we use the channel send and receive to manage the traffic. Does this mean we don't take the service of the mux and miss out on the mux matching of requests/responses?
Part of the problem is the way the channels in a server and channeladaptors work (server does not have ready handling, not possible to finding the server channels by name in the nameregistrar come to mind). If this can be bridged it would help. This is based on some work I had to do initiate traffic from the server and add monitoring capability to the server to match the client channel monitoring (and its very possible I missed something).

Currently the limitation I see with the Server and Client implementation in jpos is the server is designed to receive requests and client is mean to send requests (by adding in/out queues to the server we do lessen the pain and enable the server to initiate requests).
My view has always been the application logic needs to be independent of who is server and who is client and its send and receive should do the needful if 2 endpoints are connected.

-chhil

Alejandro Revilla

unread,
Jun 18, 2013, 8:13:36 AM6/18/13
to jpos-...@googlegroups.com
The NAT releated issue sounds similar to all ATMs connecting to a single hardware box and all traffic appears to come from a single IP (usualy a case when they are dialup atms and box does a protocol conversion), in this case differentiating of atms needs to be done based on ip + local port being used for the connection.

In this situation the toString() method in BaseChannel would give you a good key, because it includes the source IP and port as well as the destination.

 
Logons would work but ATMs, at least the ones i have worked with previously dont do logons.

I'm not following this thread very closely, but I don't understand why you would initiate messages to the ATM, you usually provide responses, and you have the ISOSource available in the request listener.

@apr

chhil

unread,
Jun 18, 2013, 9:43:01 AM6/18/13
to jpos-...@googlegroups.com
Alejandro,

For regular transaction processing the atm initiates the request.

For setting up the atm one needs to initiate requests and get an OK response from it.
Setting up of the atm : Sending down -> states , screens, keys, fits , misellaneous info (how wide the amounts will be,enabling/disabling atm features etc)  which are required for the atm to interact with the user.

A trivial ATM driver is one that would use  preloaded states screens etc on the atm and the driver is only responsible for receiving requests interpretting the transaction and handling the request.

-chhil


kishor toraskar

unread,
Feb 6, 2020, 10:21:19 AM2/6/20
to jPOS Users
Hi,
This solution is working fine. But i am getting response of initiated request in ISORequestListener(As fresh request).

On Tuesday, June 11, 2013 at 12:06:53 AM UTC+5:30, chhil wrote:
This is working code. If you can get it to work , excellent, if not there is nothing else I can do to help here.
This code basically uses the mux configured in the server to send a message to a client connected to it. I used netcat as a client that connected to port 23000.
The mux request sends the message to the client and its visible in the client
http://screencast.com/t/V0zEZSXA

Its unfortunate that you need so much of spoon feeding. All this has been covered an explained in the threads.

I have used jpos 1.8.7 and java 7 for running this.

////////////////////
//Server Deploy File

<!--File Name 10_server.xml -->
<?xml version="1.0" ?>
<server name="server-1" class="org.jpos.q2.iso.QServer" logger="Q2">
  <attr name="port" type="java.lang.Integer">8888</attr>
  <channel name="channel.1"
          class="org.jpos.iso.channel.NACChannel"
          packager="org.jpos.iso.packager.GenericPackager" logger="Q2">
     <property name="packager-config" value="cfg/iso87ascii.xml" />
     </channel>
  <request-listener class="a.b.MyRequestListener" logger="Q2" realm="incoming-request-listener">
  
  
  </request-listener>
 <in>NETWORK_IN</in>
 <out>NETWORK_OUT</out>
 
</server>


////////////////////
<!--File name : 20_qserver_mux.xml-->
<?xml version="1.0" ?>
<mux class="org.jpos.q2.iso.QMUX" logger="Q2" name="qserver-mux">
 <in>NETWORK_OUT</in>
 <out>NETWORK_IN</out>
 <key>11</key>
 <unhandled>unhandled</unhandled>
</mux>

---------------------
<!-- Bean deploy file, file name 52_sendmessage.xml-->

<test class="a.b.SendTestMessage" logger="Q2">
 
 
</test>
------------------------
//Bean to send message, make sure you have a client like netcat running and listening on port //23000
//Filename :SendTestMessage.java
package a.b;

import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOServer;
import org.jpos.q2.QBeanSupport;
import org.jpos.q2.iso.QMUX;
import org.jpos.util.NameRegistrar;

public class SendTestMessage extends QBeanSupport {

    private ISOServer isoServer;

    @Override
    protected void startService() throws Exception {


        QMUX qmux = (QMUX) NameRegistrar.getIfExists("mux.qserver-mux");
        isoServer = ISOServer.getServer("server-1");
        if (isoServer.getConnections() > 0 && qmux != null) {
            try {

                if (qmux.isConnected()) {
                    ISOMsg m = new ISOMsg();
                    m.setMTI("0100");
                    m.set(2, "123456789012345");
                    m.set(11, "901234"); // 11 needs to be there else it wont get sent,
// I have configured it as the mux key
                    m.set(41, "12345678");// As they are used as a default key by mux
                    qmux.request(m,5000);

                }

            }
            catch (ISOException e) {

            }
        }
    }

}
-------------------------
// RequestListener defined in Server but never used right now.
package a.b;

import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISORequestListener;
import org.jpos.iso.ISOSource;

public class MyRequestListener implements ISORequestListener {

    @Override
    public boolean process(ISOSource source, ISOMsg m) {


        return false;
    }

}
--------------------------------
Best of luck.

-chhil

On Mon, Jun 10, 2013 at 10:28 PM, Mark Salter <marks...@talktalk.net> wrote:
Please stop opening new threads on this same problem.


On 10/06/2013 14:27, pugazhendhi t wrote:
>
> can anyone help me in doing this ... ?
There are outstanding questions (to you) on the existing threads, please
answer those questions first.

Your questions and their lack of 'smartness' is not helping you achieve
what is a very simple thing using jPOS-ee.

The lack of information in your 'un-smart' questions is not helping...

... sorry to be so blunt.


>
> i tried in lot of way, but its of no use
You appear to be trying random things and not listening to advise or
providing the detail needed to help.


> does anyone have samples for
> this anywhere  ?
The detail you need is already available - in documentation/mailing
list/search/engine, but you have missed it or failed to follow it.

Chasing an answer for free just isn't going to help either.

Have a careful read through the link about smart questions I have shared
with you at least once and then spend some time checking you have
answered the questions poised to you (answer them just once though as
some have been asked more than once), or....

... just try and ask a single smart question on this new thread if you
find that will be easier for us all.


--
Mark

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage.
Please support jPOS, contact: sa...@jpos.org

You received this message because you are subscribed to the  "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-...@googlegroups.com

For more options, visit this group at http://groups.google.com/group/jpos-users

---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-...@googlegroups.com.

Andrés Alcarraz

unread,
Feb 8, 2020, 6:57:12 AM2/8/20
to jPOS Users
The ISOServer doesn't know about what you are interesting in processing, for that approach to work you need to ignore response messages in your Request Listeners by returning false in the process method for them.

Then they are going to be unhandled "requests" (from the Qserver's point o view) and QServer will put them in the out queue from which they are going to be taken by the QMUX to try to match previous requests.


Sent from mobile, excuse the brevity

Regards

Andrés Alcarraz

To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/6bb64b41-488a-444b-b18e-4fc10d3721e3%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages