使用Jmeter进行SWIFT报文测试

r3i60tvu  于 2022-11-09  发布在  Swift
关注(0)|答案(1)|浏览(143)

我需要帮助,我被告知要使用IBM MQ上的Jmeter对SWIFT报文类型进行性能测试,它们是用于向SWIFT网络上的金融机构发送报文的格式或模式
有人使用jmeter进行过任何测试吗?我需要帮助或示例代码,说明如何使用Jmeter对SWIFT报文进行测试,看起来我们需要在运行时更改数据。https://www.iso20022.org/15022/uhb/finmt541.htm

uqzxnwby

uqzxnwby1#

用于向IBMMQ发送消息的示例代码非常简单:

import com.ibm.msg.client.jms.JmsFactoryFactory
import com.ibm.msg.client.wmq.WMQConstants

import javax.jms.Session

def hostName = "your IBMMQ Host"
def hostPort = 1414
def channelName = "DEV.APP.SVRCONN"
def queueManagerName = "QM1"
def queueName = "DEV.QUEUE.1"

def ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER)
def cf = ff.createConnectionFactory()

cf.setStringProperty(WMQConstants.WMQ_HOST_NAME, hostName)
cf.setIntProperty(WMQConstants.WMQ_PORT, hostPort)
cf.setStringProperty(WMQConstants.WMQ_CHANNEL, channelName)
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT)
cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, queueManagerName)

def conn = cf.createConnection("app", "test")
def sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE)

def destination = sess.createQueue(queueName)

conn.start()

def producer = sess.createProducer(destination)

def payload = "your message here"
def msg = sess.createTextMessage(payload)

producer.send(msg)

producer.close()

请查看以下材料:

关于构建SWIFT报文-您已经提供了显示报文主体外观的链接。

相关问题