Comments (2)
@mehrdad2000
Sorry, but you have to provide more information than this.
I can only guess that
- this is in context of your other issue #73
- against recommendation, for some unknown reason your
JMSChannel
extendsBaseChannel
as suggested here without calling itssetConfiguration
. - somehow, possibly because you don't override some method, your JMSChannel tries to make a socket connection and Java throws an exception which leads to the
ChannelAdaptor
warning. - the following
disconnect
would then disconnect your JMSChannel.
But those are only guesses.
In any case, the issue is unlikely to be caused by this plugin or the jPOS framework, but quite possibly your own implementation, unless you have thoroughly tested it, for which you have provided no indication, and rather outside JMeter as the jPOS community recommends as well).
Until you have done your due diligence, please stop spamming more issues, but use discussions or the jPOS-users group instead.
from jmeter-iso8583.
@tilln Thank you so much for your hints, after several workaround finally figure out what happen here. :))
call function setConfiguration as you mention missed.
also, after send request I should implement disconnect method.
Here is the final JMSChannel that work with jmeter-iso8583 plugin.
package org.jpos.iso.channel;
import com.ibm.jms.JMSTextMessage;
import com.ibm.mq.jms.*;
import com.ibm.msg.client.wmq.WMQConstants;
import org.jpos.iso.ISOChannel;
import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.BaseChannel;
import org.jpos.core.Configuration;
import org.jpos.core.Configurable;
import org.jpos.core.ConfigurationException;
import javax.jms.*;
import java.io.*;
public class JMSChannel extends BaseChannel implements ISOChannel, Configurable {
private MQQueueConnectionFactory cf;
private MQQueueConnection connection;
private MQQueueSession session;
private MQQueueSender sender;
@Override
public void setConfiguration(Configuration cfg) throws ConfigurationException {
super.setConfiguration(cfg); // Call BaseChannel's setConfiguration
try {
cf = new MQQueueConnectionFactory();
cf.setHostName(cfg.get("host"));
cf.setPort(cfg.getInt("port"));
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
cf.setQueueManager(cfg.get("queueManager"));
cf.setChannel(cfg.get("channel"));
cf.setStringProperty(WMQConstants.USERID, cfg.get("user"));
cf.setStringProperty(WMQConstants.PASSWORD, cfg.get("pass"));
connection = (MQQueueConnection) cf.createQueueConnection();
session = (MQQueueSession) connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
MQQueue queue = (MQQueue) session.createQueue(cfg.get("qname"));
sender = (MQQueueSender) session.createSender(queue);
connection.start();
} catch (JMSException e) {
throw new ConfigurationException(e);
}
}
@Override
public void disconnect() throws IOException {
try {
if (sender != null) {
sender.close();
}
if (session != null) {
session.close();
}
if (connection != null) {
connection.close();
}
} catch (JMSException e) {
throw new IOException(e);
}
}
@Override
public void send(ISOMsg isoMsg) throws IOException, ISOException {
try {
// Set header (replace "0000" with your desired header value)
Configuration cfg = getConfiguration();
String headerValue = cfg.get("header");
isoMsg.setHeader(headerValue.getBytes());
//isoMsg.setHeader(cfg.get(headerValue)).getBytes()); // Replace "0000" with channelHeader
// Convert the header to a string
String headerStr = new String(isoMsg.getHeader());
TextMessage jmsMsg = session.createTextMessage();
// Append the header to the beginning of the message text
jmsMsg.setText(headerStr + new String(isoMsg.pack()));
sender.send(jmsMsg);
} catch (JMSException e) {
throw new IOException(e);
}
}
from jmeter-iso8583.
Related Issues (20)
- Iso trailer field issue HOT 2
- iso8583 non blocking iso8583 send and receive HOT 3
- Not receiving response data (body or header) in ISO 8583 using JMeter5.4 HOT 41
- Please add ready to use jmx scenario for iso8583 HOT 3
- bitmap issue HOT 3
- Send message to mq with “queue name, channel name, …” through jmeter-iso8583 plugin HOT 20
- jmeter-iso8583 reply to request that recieve HOT 1
- Server simulator HOT 3
- ISO8583 - Server mode - Sign on message issue HOT 3
- Mac algorithm DESEDE ANSI X9.19 HOT 21
- edit packager configuration through jemter ui like "ISO8583 Message Component" HOT 1
- use value of fields in one sampler as variable in another sampler for creating 420 (reverse message) HOT 6
- packager iso2003ascii.xml HOT 1
- Using single jmeter instance to generate request and response HOT 18
- put generated message of jmeter iso8583 in jrs223 sample as variable HOT 1
- Use MAC Generation function in JRS223 (groovy script) HOT 1
- feature that generate mac in ISO8583 Crypto PreProcessor UI based on specific fields HOT 7
- Feature generate field 35 (track2) in iso8583 plugin HOT 3
- Feature Listbox for fields in iso 8583 sampler HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jmeter-iso8583.