1 安装websphere mq 并启动
2 websphere mq 建立 queue Manager (如:迟消慎MQSI_SAMPLE_QM)
3 建立queue 类型选择 Local类型码敬 的 (如lq )
3 建立channels 类型选择Server Connection (如BridgeChannel)
java 代码如下:
package test.mq
import com.ibm.mq.*
/*
* 成功的访问mq 的桥镇java 类
*/
public class FirstMqTest {
//public static void main(String[] args[]){
//FirstMqTest first = new FirstMqTest()
//first.test()
//}
public static void main(String args[]){
FirstMqTest first = new FirstMqTest()
first.test()
}
public void test(){
String qManager = "MQSI_SAMPLE_QM"//QueueManager name
String qName = "lq"//Queue Name
try {
//configure connection parameters
MQEnvironment.hostname="172.16.17.123"//MQ Server name or IP
//MQEnvironment.port=1414//listenr port
MQEnvironment.channel="BridgeChannel"//Server-Connection Channel
MQEnvironment.CCSID =1381
// Create a connection to the QueueManager
System.out.println("Connecting to queue manager: "+qManager)
MQQueueManager qMgr = new MQQueueManager(qManager)
// Set up the options on the queue we wish to open
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT
// Now specify the queue that we wish to open and the open options
System.out.println("Accessing queue: "+qName)
MQQueue queue = qMgr.accessQueue(qName, openOptions)
// Define a simple WebSphere MQ Message ...
MQMessage msg = new MQMessage()
// ... and write some text in UTF8 format
msg.writeUTF("Hello, World!")
// Specify the default put message options
MQPutMessageOptions pmo = new MQPutMessageOptions()
// Put the message to the queue
System.out.println("Sending a message...")
/*
* 在此测试一下 mq 的传输次列
*
*/
for(int j=0j<5j++){
String str ="test11111111111"
str = str+j
msg.writeUTF(str)
queue.put(msg, pmo)
}
queue.put(msg, pmo)
// Now get the message back again. First define a WebSphere MQ message
// to receive the data
MQMessage rcvMessage = new MQMessage()
// Specify default get message options
MQGetMessageOptions gmo = new MQGetMessageOptions()
// Get the message off the queue.
System.out.println("...and getting the message back again")
queue.get(rcvMessage, gmo)
// And display the message text...
String msgText = rcvMessage.readUTF()
System.out.println("The message is: " + msgText)
// Close the queue
System.out.println("Closing the queue")
queue.close()
// Disconnect from the QueueManager
System.out.println("Disconnecting from the Queue Manager")
qMgr.disconnect()
System.out.println("Done!")
}
catch (MQException ex) {
System.out.println("A WebSphere MQ Error occured : Completion Code "
+ ex.completionCode + " Reason Code " + ex.reasonCode)
}
catch (java.io.IOException ex) {
System.out.println("An IOException occured whilst writing to the message buffer: "
+ ex)
}
}
}
websphere6.0的安装有两种方式1、图形化的2、slient modewebsphere6.0 WebSphere Application Server 的安装过程和以下几种组件的安装是独立过程
1、Application Client for WebSphere Application Server
2、Web server plug-ins for WebSphere Application Server
3、IBM HTTP Server
使用启动板launchpad安装
在6.0中,websphere application server network deployment的安装分为两个步骤
1、使用安装向导安装一组共享核心文件
2、使用“概要表创建”向导创建deployment manager概要表,应用程序概要表(application server profile)和定制概要表(custom profile)
使用network deployment可以实现两种websphere application server拓扑
1、独立应用程序服务器
2、应用程序受管组
浏览解决方案安装图表选择独立应用程序服务器安装
一直按照wizard要求一步步安装
安装完后,1、检查install_dir/logs/log.txt文件,INSTCONFSUCCESS表示安装成功,INSTCONFFAIL 表示失败2、检察install_dir/logs/wasprofile/wasprofile_create_profile_name.log file
3、检查install_dir/profiles/profile_name/logs/pctLog.txt
表示安装过程中虽然有错但是安装还是可用
安装成功后还可以在启动面板All Programs >IBM WebSphere >Application Server Network Deployment v6
看见快捷方式
概要表创建:
1、如果要为一个多结点,多机应用服务器组创建一个管理节点,就必须先创建一个deployment manager profile
2、如果创建一个application server profile,默认的server1 进程能够启动
3、deployment manager 是一个可以配置碰帆老的空节点
选择创建application server profile
输入概要表名,节点名,主机名,端口号都用默认值,用户名/密码
?
除了在轿喊安装结束后,用默认的方法创建概要表外,还有两笑升种办法
Install_dir/bin/ProfileCreator
或者install_dir/firststep?
?创建概要表时选择将应用服务器作为windows服务在windows平台上运行
在cmd窗口进入目录install_dir/appserver/profiles/概要表名/bin? 输入命令startserver server1,然后可以看到install_dir/appserver/profiles/概要表名/logs/server1/startserver.log中显示启动成功或者失败。
您好!
安装SSL证书主要将游局SSL证书配弊磨汪置到服务器环租仔境。安装教程:网页链接
目前全球服务器环境主要分为4个类型:Apache、IIS、Nginx、Tomcat
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)