ES20 - Port Queues

Hi,
I have a 7609 with a WS-X6748-GE-TX. When I show the port capabilities I
can see rx-(1q8t), tx-(1p3q8t)
If I show queueing on an interface I see all the WRED and WRR queue
configuration.
This is great, I can make changes and view changes.
I also have an ES20 and ES20+ line card in the chassis. When I show the
port capabilities I see x-(NotDef-t), tx-(NotDef-t)
When I show queueing on an interface I see nothing for the ES20. For the
ES20+ I get
Interface GigabitEthernet1/1 queueing strategy: Weighted Round-Robin
Port QoS is enabled
Port is untrusted
Extend trust state: not trusted [COS = 0]
Default COS is 0
So the ES20 tells me nothing and the ES20+ only shows a subset of what I
see with the WS-X6748-GE-TX.
Is there something I am missing in my config to show what queues I have
available on the ES line cards '(1p3q8t)'
From reading the line card configuration guides I can see ingress
scheduling is not supported and egress is but when I configure a egress
policy-map with my random-detect configuration I still see no queueing
info for the ports.
Thanks
Anthony

Hi Anthony,
ES and 6748 are two completely different type of LC based on different hardware.
ES20 LC support 16K hw queues to give you an example in addition to H-QoS, shaping,..
You should use the show policy-map interface command instead.
HTH
Laurent.

Similar Messages

  • QoS - Ingress Port Queuing (SP or default) based on CoS?

    Guys,
    the following URL is excellent for the QoS flow through a 6500. Also had an excellent briefing off a mate in my team :)
    http://www.cisco.com/en/US/customer/tech/tk543/tk762/technologies_white_paper09186a00800b0828.shtml
    One question on this. It states the following :-
    A frame enters the switch and is initially processed by the port ASIC that received the frame. It will place the frame into a Rx queue. Depending on the Catalyst 6000 family line card, there will be one or two Rx queues.
    The port ASIC will use the CoS bits as an indicator of which queue to place the frame into (if multiple input queues are present). If the port is classified as untrusted, the port ASIC can overwrite the existing CoS bits based on a predefined value.
    The statement "The port ASIC will use the CoS bits as an indicator of which queue to place the frame into"
    does this mean that the frame can only be put into the Rx queue based on an L2 (isl, dot1q) CoS value, OR can the frame be place in an Rx queue based on an L3 DSCP or ip prec value? ALSO, what if there is no CoS value, (ie the frame is not from a trunk, ie untagged)
    then it goes off for internal DSCP markings (which I understand all about now I hope) :)
    Could someone please clear this small point up for me.
    Many thx indeed,
    Ken

    Hey dude, (also thx Simon also)
    This is the thing, according to the documentation, the DSCP-COS mappings are for mapping the internal DSCP value on the PFC (i think) which come well after the input queue assignment phase so i would like to think that the input ASIC says what you are implying.
    The extrat from the doc is
    As mentioned earlier, the switch uses a DSCP value internally to assign a predetermined level of service to that frame. As a frame enters a trusted port, the administrator can configure the port to look at either the existing CoS, IP precedence, or DSCP value to set the internal DSCP value. Alternatively, the administrator can set a predefined DSCP to every packet that enters the port.
    it says "the administrator can configure the port to look at either the existing CoS, IP precedence, or DSCP value to set the internal DSCP value" It does not say that it will look at the COS, IPPREC or DSCP to move the incoming packet into the relevant Rx Q?
    Am I being a little silly here? Sorry if I am :)
    I suppose what I am trying to say is. A frame comes into a switchport that has two queues, SP and default. If it comes in on a non-trunk port (has no CoS marking) how would you determine how to get a frame into a specific Rx queue (if you have two of them) based on CoS?
    Kind regards,
    Ken

  • JMS adapter fails to open IBM WebSphere MQ Manager V6 Remote Queue

    Hello,
    We are trying to connect to a Remote Queue with the SAP PI 7.0 SP9 JMS adapter to IBM WebSphere MQ V6 on Linux SLES9 x86_64.
    We did deployed the JMS-adapter with the V6 native libaries on SAP PI.
    In the Communication Channel we use the Adapter Type = JMS, Sender, Transport Protocol = WebSphereMQ(non-JMS).
    The MQ Queue Manager is on the same server as SAP PI so we use localhost, Server Port, Queue Manager Name, Channel Name and JMS Queue Name
    The <sid>adm user is a member of the mqm group.
    When I check the RWB I see this fault message:
    Error during channel initialization; exception trace: javax.jms.JMSException: <b>MQJMS2008: failed to open MQ Queue</b> at ...
    and also
    com.ibm.mq.MQException: <b>MQJE001: Completion Code 2, Reason 2045</b>
    When we lookup the reason 2045 we get this explaination on MQ:
    MQRC_OPTION_NOT_VALID_FOR_TYPE
    We also have a type = Receiver Communication Channel on the same MQ Queue Manager that one is working fine.
    Please advise!
    Best regards,
    Mike Laanen

    Mike,
    check whether the Queues are created and activated if it done. then check whether you have authorization for those queues.
    Regards
    Sreeram.G.Reddy

  • GigaEtherchannel+Dot1q configuration

    Hi all,
    I would like someone to help me regarding the following issue that I have found trying to configure Etherchannel+dot1q in a b2b connection from an ES20+ port to a LAN SW board.
    We have a 7600 with c7600rsp72043-advipservicesk9-mz.122-33.SRE3.
    show module
    Mod Ports Card Type                              Model             
      1    0  4-subslot SPA Interface Processor-400  7600-SIP-400      
      2    0  4-subslot SPA Interface Processor-400  7600-SIP-400      
      3   48  CEF720 48 port 10/100/1000mb Ethernet  WS-X6748-GE-TX    
      4   22  7600 ES+                               76-ES+XC-40G3CXL  
      5    2  Route Switch Processor 720 (Hot)       RSP720-3CXL-GE    
      6    2  Route Switch Processor 720 (Active)    RSP720-3CXL-GE   
    There are two b2b connections between Gi3/1-2 -> 4/0/0-1
    I'm trying to configure the following:
    !Initial Conf:
    vlan 2
    name VLAN0002
    interface GigabitEthernet3/1
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 2
    switchport mode trunk
    switchport nonegotiate
    mls qos trust dscp
    spanning-tree portfast trunk
    spanning-tree bpduguard disable
    spanning-tree link-type point-to-point
    channel-group 40 mode on
    no shut
    interface GigabitEthernet3/2
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 2
    switchport mode trunk
    switchport nonegotiate
    mls qos trust dscp
    spanning-tree portfast trunk
    spanning-tree bpduguard disable
    spanning-tree link-type point-to-point
    channel-group 40 mode on
    no shut
    interface Port-channel40
    switchport
    switchport trunk encapsulation dot1q
    switchport trunk allowed vlan 2
    switchport mode trunk
    switchport nonegotiate
    mls qos trust dscp
    no shut
    interface GigabitEthernet4/0/0
    mac-address 0248.0010.0400
    mtu 1650
    no ip address
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    ip mtu 1500
    load-interval 30
    speed 1000
    no mls qos trust
    channel-group 45 mode on
    hold-queue 1500 in
    no shut
    interface GigabitEthernet4/0/1
    mac-address 0248.0010.0401
    mtu 1650
    no ip address
    no ip redirects
    no ip unreachables
    no ip proxy-arp
    ip mtu 1500
    load-interval 30
    speed 1000
    no mls qos trust
    channel-group 45 mode on
    hold-queue 1500 in
    no shut
    interface Port-channel45
    mtu 1650
    no ip address
    no shut
    interface Port-channel45.2
    no shut
    end
    !                          TESTS
    !Verify : Po40 (Switch Card), Po45 (ES Card) and vlan 2
    BB1#show etherchannel 40 summary
    Flags:  D - down        P - bundled in port-channel
            I - stand-alone s - suspended
            H - Hot-standby (LACP only)
            R - Layer3      S - Layer2
            U - in use      f - failed to allocate aggregator
            M - not in use, minimum links not met
            u - unsuitable for bundling
            w - waiting to be aggregated
            d - default port
    Number of channel-groups in use: 2
    Number of aggregators:           2
    Group  Port-channel  Protocol    Ports
    ------+-------------+-----------+-----------------------------------------------
    40     Po40(SU)         -        Gi3/1(P)    Gi3/2(P)
    Last applied Hash Distribution Algorithm: Fixed
    BB1#show etherchannel 45 summary
    Flags:  D - down        P - bundled in port-channel
            I - stand-alone s - suspended
            H - Hot-standby (LACP only)
            R - Layer3      S - Layer2
            U - in use      f - failed to allocate aggregator
            M - not in use, minimum links not met
            u - unsuitable for bundling
            w - waiting to be aggregated
            d - default port
    Number of channel-groups in use: 2
    Number of aggregators:           2
    Group  Port-channel  Protocol    Ports
    ------+-------------+-----------+-----------------------------------------------
    45     Po45(RU)         -        Gi4/0/0(P)  Gi4/0/1(P)
    Last applied Hash Distribution Algorithm: Fixed
    BB1#show vlan brief
    *Apr 28 14:48:46.411: %SYS-5-CONFIG_I: Configured from console by console
    VLAN Name                             Status    Ports
    1    default                          active
    2    VLAN0002                         active
    3    vlan_3_prueba                    active
    1002 fddi-default                     act/unsup
    1003 trcrf-default                    act/unsup
    1004 fddinet-default                  act/unsup
    1005 trbrf-default                    act/unsup
    !Error trying to create a sub-interface dot1q with the Po45
    BB1(config)#int port-channel 45.2
    BB1(config-subif)#encapsulation dot1Q 2
    Command rejected: VLAN 2 cannot be allocated. VLANs 1-1005 are VTP VLANs
    VTP mode is client or server and must be changed to Transparent to use VLANs 1-1005
    !Change to VTP Mode Transparent/Server to test on transparent mode
    !with dot1Q 2
    BB1(config-subif)#exit
    BB1(config)#vtp mode transparent
    Setting device to VTP Transparent mode for VLANS.
    BB1(config)#int po45.2
    BB1(config-subif)#encapsulation dot1Q 2
    Command rejected: VLAN 2 not available
    !Now we can assign with dot1Q from the 1005 vlan but it does not allow
    !to creat the vlan in the switch board
    BB1(config)#vtp mode transparent
    Setting device to VTP Transparent mode for VLANS.
    BB1(config)#
    BB1#show vtp status
    VTP Version capable             : 1 to 3
    VTP version running             : 3
    VTP Domain Name                 : BB1
    VTP Pruning Mode                : Disabled
    VTP Traps Generation            : Disabled
    Device ID                       : 8843.e1de.bb00
    Feature VLAN:
    VTP Operating Mode                : Transparent
    Number of existing VLANs          : 7
    Number of existing extended VLANs : 0
    Feature MST:
    VTP Operating Mode                : Transparent
    Feature UNKNOWN:
    VTP Operating Mode                : Transparent
    BB1(config)#int po45.2
    BB1(config-subif)#encapsulation dot1Q 1006
    BB1(config-subif)#ip address 10.10.10.1 255.255.255.0
    BB1(config-subif)#exit
    BB1(config)#vlan 1006
    VLAN id: 1006 is an internal vlan id - cannot use it to create a VTP VLAN.
    BB1(config)#int po45.2
    BB1(config-subif)#no encapsulation dot1Q 1006
    BB1(config-subif)#exit
    BB1(config)#vlan 1006
    BB1(config-vlan)#name Test
    BB1(config-vlan)#exit
    BB1(config)#int po45.2
    BB1(config-subif)#encapsulation dot1Q 1006
    Command rejected: VLAN 1006 not available
    BB1(config-subif)#exit
    BB1(config)#vtp mode server
    Setting device to VTP Server mode for VLANS.
    BB1(config)#
    BB1#show vtp status
    VTP Version capable             : 1 to 3
    VTP version running             : 3
    VTP Domain Name                 : BB1
    VTP Pruning Mode                : Disabled
    VTP Traps Generation            : Disabled
    Device ID                       : 8843.e1de.bb00
    Feature VLAN:
    VTP Operating Mode                : Server
    Number of existing VLANs          : 7
    Number of existing extended VLANs : 1
    Configuration Revision            : 0
    Primary ID                        : 0000.0000.0000
    Primary Description               :
    MD5 digest                        : 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
                                        0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
    Feature MST:
    VTP Operating Mode                : Transparent
    Feature UNKNOWN:
    VTP Operating Mode                : Transparent
    BB1(config)#int po45.2
    BB1(config-subif)#encapsulation dot1Q 1006
    Command rejected: VLAN 1006 not available
    May someone help me to understand what I'm doing wrong, or if there is a bug or something with this kind of scenario?.
    Thanks in advance for your help.

    Ok so maybe an SFP issue....
    Ethernet1/31
        transceiver is present
        type is Unknown Type-(unknown)
        name is CISCO-FINISAR  
        part number is FTLF8528P2BCV-CS
        revision is D  
        serial number is FNS154703MG    
        nominal bitrate is 8500 MBit/sec
        Link length supported for 50/125um fiber is 50 m
        Link length supported for 50/125um fiber is 150 m
        Link length supported for 62.5/125um fiber is 20 m
        cisco id is --
        cisco extended id number is 4
    Ethernet1/32
        transceiver is present
        type is Unknown Type-(unknown)
        name is FINISAR CORP.  
        part number is FTLF8524P2BNV  
        revision is A  
        serial number is U9K0XD6        
        nominal bitrate is 4200 MBit/sec
        Link length supported for 50/125um fiber is 150 m
        Link length supported for 62.5/125um fiber is 70 m
        cisco id is --
        cisco extended id number is 4

  • Problem with threads running javaw

    Hi,
    Having a problem with multi thread programming using client server sockets. The program works find when starting the the application in a console using java muti.java , but when using javaw multi.java the program doesnt die and have to kill it in the task manager. The program doesnt display any of my gui error messages either when the server disconnect the client. all works find in a console. any advice on this as I havent been able to understand why this is happening? any comment would be appreciated.
    troy.

    troy,
    Try and post a minimum code sample of your app which
    does not work.
    When using javaw, make sure you redirect the standard
    error and standard output streams to file.
    Graeme.Hi Graeme,
    I dont understand what you mean by redirection to file? some of my code below.
    The code works fine under a console, code is supposed to exit when the client (the other server )disconnects. the problem is that but the clientworker side of the code still works. which under console it doesnt.
    public class Server{
    ServerSocket aServerSocket;
    Socket dianosticsSocket;
    Socket nPortExpress;
    ClientListener aClientListener;
    LinkedList queue = new LinkedList();
    int port = 0;
    int clientPort = 0;
    String clientName = null;
    boolean serverAlive = true;
    * Server constructor generates a server
    * Socket and then starts a client threads.
    * @param aPort      socket port of local machine.
    public Server(int aPort, String aClientName, int aClientPort){
    port = aPort;
    clientName = aClientName;
    clientPort = aClientPort;
    try{
    // create a new thread
    aServerSocket = new ServerSocket(port) ;
    // connect to the nPortExpress
    aClientListener = new ClientListener(InetAddress.getByName(clientName), clientPort, queue,this);
    // aClientListener.setDaemon(true);
    aClientListener.start();
    // start a dianostic port
    DiagnosticsServer aDiagnosticsServer = new DiagnosticsServer(port,queue,aClientListener);
    // System.out.println("Server is running on port " + port + "...");
    // System.out.println("Connect to nPort");
    catch(Exception e)
    // System.out.println("ERROR: Server port " + port + " not available");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Server port " + port + " not available", JOptionPane.ERROR_MESSAGE);
    serverAlive = false;
    System.exit(1);
    while(serverAlive&&aClientListener.hostSocket.isConnected()){
    try{
    // connect the client
    Socket aClient = aServerSocket.accept();
    //System.out.println("open client connection");
    //System.out.println("client local: "+ aClient.getLocalAddress().toString());
    // System.out.println("client localport: "+ aClient.getLocalPort());
    // System.out.println("client : "+ aClient.getInetAddress().toString());
    // System.out.println("client port: "+ aClient.getLocalPort());
    // make a new client thread
    ClientWorker clientThread = new ClientWorker(aClient, queue, aClientListener, false);
    // start thread
    clientThread.start();
    catch(Exception e)
    //System.out.println("ERROR: Client connection failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client connection failure", JOptionPane.ERROR_MESSAGE);
    }// end while
    } // end constructor Server
    void serverExit(){
         JOptionPane.showMessageDialog(null, "Server ","ERROR: nPort Failure", JOptionPane.ERROR_MESSAGE);
         System.exit(1);
    }// end class Server
    *** connect to another server
    public class ClientListener extends Thread{
    InetAddress hostName;
    int hostPort;
    Socket hostSocket;
    BufferedReader in;
    PrintWriter out;
    boolean loggedIn;
    LinkedList queue;      // reference to Server queue
    Server serverRef; // reference to main server
    * ClientListener connects to the host server.
    * @param aHostName is the name of the host eg server name or IP address.
    * @param aHostPort is a port number of the host.
    * @param aLoginName is the users login name.
    public ClientListener(InetAddress aHostName, int aHostPort,LinkedList aQueue,Server aServer)      // reference to Server queue)
    hostName = aHostName;
    hostPort = aHostPort;
    queue = aQueue;
    serverRef = aServer;      
    // connect to the server
    try{
    hostSocket = new Socket(hostName, hostPort);
    catch(IOException e){
    //System.out.println("ERROR: Connection Host Failed");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort Failed", JOptionPane.ERROR_MESSAGE);     
    System.exit(0);
    } // end constructor ClientListener
    ** multi client connection server
    ClientWorker(Socket aSocket,LinkedList aQueue, ClientListener aClientListener, boolean diagnostics){
    queue = aQueue;
    addToQueue(this);
    client = aSocket;
    clientRef = aClientListener;
    aDiagnostic = diagnostics;
    } // end constructor ClientWorker
    * run method is the main loop of the server program
    * in change of handle new client connection as well
    * as handle all messages and errors.
    public void run(){
    boolean alive = true;
    String aSubString = "";
    in = null;
    out = null;
    loginName = "";
    loggedIn = false;
    while (alive && client.isConnected()&& clientRef.hostSocket.isConnected()){
    try{
    in = new BufferedReader(new InputStreamReader(client.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(client.getOutputStream()));
    if(aDiagnostic){
    out.println("WELCOME to diagnostics");
    broadCastDia("Connect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    out.println("WELCOME to Troy's Server");
    broadCastDia("Connect : client "+client.getInetAddress().toString());
         out.flush();
    String line;
    while(((line = in.readLine())!= null)){
    StringTokenizer aStringToken = new StringTokenizer(line, " ");
    if(!aDiagnostic){
    broadCastDia(line);
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    else{
    if(line.equals("GETIPS"))
    getIPs();
    else{
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    } // end while
    catch(Exception e){
    // System.out.println("ERROR:Client Connection reset");
                             JOptionPane.showMessageDialog(null, (e.toString()),"ERROR:Client Connection reset", JOptionPane.ERROR_MESSAGE);     
    try{
    if(aDiagnostic){
    broadCastDia("Disconnect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    broadCastDia("Disconnect : client "+client.getInetAddress().toString());
         out.flush();
    // close the buffers and connection;
    in.close();
    out.close();
    client.close();
    // System.out.println("out");
    // remove from list
    removeThreadQueue(this);
    alive = false;
    catch(Exception e){
    // System.out.println("ERROR: Client Connection reset failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client Connection reset failure", JOptionPane.ERROR_MESSAGE);     
    }// end while
    } // end method run
    * method run - Generates io stream for communicating with the server and
    * starts the client gui. Run also parses the input commands from the server.
    public void run(){
    boolean alive = true;
    try{
    // begin to life the gui
    // aGuiClient = new ClientGui(hostName.getHostName(), hostPort, loginName, this);
    // aGuiClient.show();
    in = new BufferedReader(new InputStreamReader(hostSocket.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(hostSocket.getOutputStream()));
    while (alive && hostSocket.isConnected()){
    String line;
    while(((line = in.readLine())!= null)){
    System.out.println(line);
    broadCast(line);
    } // end while
    } // end while
    catch(Exception e){
    //     System.out.println("ERRORa Connection to host reset");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort reset", JOptionPane.ERROR_MESSAGE);
    try{
    hostSocket.close();
         }catch(Exception a){
         JOptionPane.showMessageDialog(null, (a.toString()),"ERROR: Exception", JOptionPane.ERROR_MESSAGE);
    alive = false;
    System.exit(1);
    } // end method run

  • "Portable" way to do message passing between threads?

    (I posted this on the Apple Developer Forums already, but since that forum is only accessible to registered and paid iPhone developers, I thought it would be nice to put it here as well so as to get some more potential eyeballs on it. I apologize if this kind of "cross-posting" is not kosher/is frowned upon around here.)
    Hey everybody,
    "Long-time listener, first-time caller," heh.
    I've been working for the past 2-3 months on my very first iPhone app. Actually, what I've been working on is a framework that I plan to use in an iPhone app of my own but which I am also trying to write for the "lowest-common-denominator" so that I (and others) can use it in other apps written for both Mac and iPhone.
    Not only is this my first time writing an iPhone app, it is my first time writing for any Apple platform. In fact, it is my first time using Objective-C, period. I cannot stress this enough: I am a "n00b." So go easy on me. I also have not worked with threading before this, either, on any platform, so the learning curve for me here is rather significant, I'm afraid. I am NOT afraid of either taking the time to learn something properly OR of rolling up my shirtsleeves and working. However, on account of my experiences so far, I am finding myself (not to flame or anything!) quickly becoming frustrated by and disillusioned with not so much Objective-C itself, but the Foundation frameworks.
    So with that said, read on, if you dare...
    The basic idea behind my project is that the framework I am writing will present an API to developers which will allow them to write client apps that interact with a particular network appliance or network-aware embedded system. I already have my basic set of classes up and functioning, and the framework works to my satisfaction both on MacOS and iPhoneOS. The platforms I am targeting are MacOS X Tiger 10.4 and later, and iPhoneOS, and up until this point, I've managed to keep a codebase that works on all of the above.
    What I wanted to do next was add some multithreaded goodness to the mix. (Woe is me.) I have asynchronous network socket I/O working within the main thread, and it, in fact, works a treat. In my test app on the phone, I've managed to keep the UI nice and responsive by using the main thread's runloop efficiently. But even though TCP async I/O works fine within the main thread, I want to be able to split out and offload the processing of any data received by the app from the appliance to its own thread. (It is possible, and even desirable, for an application using this framework to be connected to multiple appliances simultaneously.)
    My idea, in order to try to keep things as simple and as clean as possible, was to implement a wrapper class that presented my other main class as an "actor." So, rather than instantiating my main class, one would create an instance of the wrapper class which would in turn control a single instance of my main class and spawn its own thread that the network connection and all data processing for that particular connection would run within.
    (I hope I'm making sense so far...)
    Out of the gate, writing a subclass of NSThread sounds like the logical design choice for an "actor-type" thread, but because I was trying to maintain Tiger compatibility, I stuck with +detachNewThreadSelector:etc.
    Once I decided to pursue the actor model, though, the main problem presented itself: how to best pass messages between the main thread and all of the "actor" threads that might be spawned?
    I stumbled upon -performSelector:onThread:withObject:, and knew instantly that this was exactly what I was looking for. Unfortunately, it doesn't exist on Tiger; only its much more limited little brother -performSelectorOnMainThread:withObject: does. So I kept looking.
    All of the pre-Leopard documentation, tutorials, and sample code that I read indicated that to pass messages between threads, I needed to basically pretend that the threads were separate processes and use the expensive Distributed Objects mechanism to get messages back and forth. Unfortunately, even if that WAS a desirable option, iPhoneOS does not have any support for DO! Grrr...
    Finally, I thought I found the answer when I ran into a third-party solution: the InterThreadMessaging library from Toby Paterson (available @ http://homepage.mac.com/djv/FileSharing3.html). In this library, the author basically implemented his own version of -performSelector:onThread:withObject: called -performSelector:withObject:inThread:. Sounds close enough, right? And actually, it is pretty darn close. It's made to do exactly what it sounds like, and it does it in a platform-neutral way that works on pre-Leopard systems as well as iPhoneOS, using Mach ports instead of DO.
    (...wellll, ALMOST. I discovered after I built a small test app around it that it actually isn't "iPhone-clean." The author used an NSMapTable struct and the NSMap*() functions, which don't exist in iPhoneOS, and he also implemented the handlePortMessage delegate method, but although iPhoneOS has NSPort, it DOESN'T have NSPortMessage. GAAARGH. So I took the time to replace the NSMapTable stuff with NSValue-wrapped objects inside of an NSMutableDictionary, and replaced the handlePortMessage method implementation with a handleMachMessage method, which took some doing because I had to figure out the structure of a Mach message, NO thanks to ANY of the available documentation...)
    Once I started using it, though, I quickly discovered that this implementation wasn't up to snuff. My "actor" class and my main thread will be passing a ton of messages to each other constantly whenever there is network activity, and with InterThreadMessaging, I found that whenever activity started to ramp up, it would collapse on itself. This mostly took the form of deadlocks. I found a note that someone else wrote after experiencing something similar with this library (quoted from DustinVoss @ http://www.cocoadev.com/index.pl?InterThreadMessaging):
    "It is possible to deadlock this library if thread A posts a notification on thread B, and the notification on B causes a selector or notification to be posted on thread A. Possibly under other circumstances. I have resolved this in my own code by creating an inter-thread communication lock. When a thread wants to communicate, it tries the lock to see if another thread is already using the InterThreadMessaging library, and if it can't get the lock, it posts a message to its own run-loop to try again later. This is not a good solution, but it seems to work well enough."
    So I tried implementing what he described using a global NSLock, and it did help with some of the deadlocks. But not all. I believe the culprit here is the Mach ports system itself (from the NSPortMessage documentation for -sendBeforeDate:):
    "If the message cannot be sent immediately, the sending thread blocks until either the message is sent or aDate is reached. Sent messages are queued to minimize blocking, but failure can occur if multiple messages are sent to a port faster than the portís owner can receive them, causing the queue to fill up."
    InterThreadMessaging in fact calls -sendBeforeDate: and exposes the deadline option, so I tried setting a really short time-to-live on the Mach messages and then intercepted any NSPortTimeoutExceptions that were thrown; upon catching said exceptions, I would then re-queue up the message to be sent again. It worked, but Performance. Was. A. Dog. At least the message queue wouldn't be full indefinitely anymore, causing the main thread to block, but during the whole time that these messages were expiring because the queue was full and then being re-queued, either the main thread was trying to send more messages or the actor thread was trying to send more messages. And as far as I can tell, the Mach ports queue is global (at the very least, there is seemingly only one per process). The message would get through with this model...eventually.
    JUST IN CASE the problem happened to be something I screwed up as I was rewriting portions of the InterThreadMessaging library so that it would compile and work on the iPhone SDK, I substituted in the original version of the library in my Mac test app to see if any of these problems became non-issues. I found that both versions of the library -- mine and the original -- performed identically. So that wasn't it.
    Finally, in frustration I said, "screw it, I'm going to try it the Leopard way," and replaced all of the method calls I was making to InterThreadMessaging's -performSelector:withObject:inThread: with calls to Foundation's native -performSelector:onThread:withObject: instead, changing nothing else within my code in the process. And wouldn't you know: IT WORKED GREAT. Performance was (and is) fantastic, about on-par with the non-threaded version when only dealing with a single connection/instance of my class.
    So, in the end, I was able to do nothing to salvage the InterThreadMessaging implementation of cross-thread method calling, and as far as I can tell, I'm out of (good) options. And thus my mind is filled with questions:
    How is the Leopard -performSelector:onThread: method implemented? I'm guessing not using Mach ports, given that I didn't have the same blocking & deadlocking problems I had with InterThreadMessaging. Is it possible to re-implement this Leopard+ method in a similar manner as a category to NSObject under Tiger? Or is it possible, perhaps, to increase the size of the Mach ports queue so that InterThreadMessaging works at a sane level of performance? Or -- I'm getting desperate here -- is there any way that I could trick -performSelectorOnMainThread: to target a different thread instead? (I am assuming here that -performSelectorOnMainThread is implemented under-the-hood much like the new -performSelector:onThread: is implemented, but with a hard-coded NSThread pointer built-in to the code, and that the new method just exposes a more flexible interface to what is basically the same code. I'm probably wrong...) Is there another third-party library out there that I've missed that fits my requirements for being able to do message-passing between threads in an efficient and portable manner?
    I refuse to believe that there is no way for me to maintain compatibility with all of the platforms I wish to support without having to resort to making preprocessor #ifdef spaghetti out of my code. And there SURELY has to be a better way of doing cross-thread message passing in Tiger without using Distributed Objects, for Pete's sake! Is this really how people did it for years-on-end since the dawn of NeXT up until the advent of Leopard? And if there really, genuinely wasn't another alternative, then what is up with the lack of DO in iPhoneOS?? Does Apple seriously intend for developers who have good, solid, tested and working code to just chuck it all and start over? What if there was some aspect of DO that previous implementations relied upon that cannot be recreated with simple -performSelector:onThread: calls? (I don't know what those aspects would be...just a hypothetical.) I mean, I can understand needing to write new stuff from scratch for your UI given how radically different the interface is between the Mac and iPhone, but having to reimplement back-end guts such as something as elemental as threads...really?!
    I do laud the inclusion of the new method in Leopard as well as the new ability to subclass NSThread itself. But for those of us that need to support Tiger for one reason or another, some of these restrictions and omissions within iPhoneOS seem like rather pointless (and frustrating) roadblocks.
    As I hope is obvious here, I have tried to do my homework before throwing up my hands and pestering y'all. If you have the patience to deal with me, please tell me what I am missing.
    Thanks for taking the time to read,
    -- Nathan

    Thanks again for your patience. Comments below.
    etresoft wrote:
    It is pretty unusual that anyone would want to call perfomrSelector on any thread other than the main thread.
    What I described in my original post was not a worker thread, but an "actor."
    It is hard for me to answer this question because there are so many options available to do "message passing". The fact that you think there are so few tells me that you really aren't sure what you need to use.
    I didn't say there were few options for message passing. I said there were few options for message passing that fit my criteria, which are that any potential solutions should both A) work efficiently and with good performance, and B) be available both pre-Leopard AND on the iPhone. -performSelector: ain't available before Leopard. Distributed Objects is overkill. Kernel Mach messages apparently have a high overhead, too, as my experience with the third-party library I wrote about in my original message shows.
    ...consider notifications.
    I thought notifications couldn't be posted across threads, either. How do I post a notification to another thread's default notification center or notification queue from a different thread?
    The notification center is owned by the process. Each run loop can listen for just the notifications it wants. You don't "pass" or "send" notifications, you run then up the flagpole for all to see.
    I am aware of how to use notifications. The documentation for NSNotificationCenter clearly states that "In a multithreaded application, notifications are always delivered in the thread in which the notification was posted, which may not be the same thread in which an observer registered itself."
    So, again, I don't see how one thread can post a notification in such a way that the observer's registered method is executed in another thread (posting notifications "across threads"). This probably isn't a big deal if you are using mutexes (assuming you don't actually care which thread carries out the task associated with the notification posting), but as I said before, this is not what I'm after.
    I don't know what you are really after.
    Allow me to attempt to explain a second time, in a more concise fashion.
    My app will have multiple, persistent TCP connections open, one connection per remote device. The user will be able to select a task to execute on a particular device that we have a connection open to, and get back from the application real-time updates as to the progress or results of the execution of that task. In certain cases, the length of the task is infinite; it will keep executing forever and sending back results to my application which will update its display of the results every second that ticks by until the user STOPS that particular task.
    This can be done simply using async I/O in the main runloop, sure. But if I were going to thread this so that I could be processing the results I've received back from one *or more* remote devices while also doing something else, given that I will only have one (persistent) connection open to any given remote device that I'm interacting with (that is to say, I won't be opening up a separate TCP session for every single task I want to execute on a single device simultaneously), it makes sense _to me_ to implement this as I've described: with every connection to each remote device getting its own thread that lasts for the lifetime of the TCP session (which could be the entire time the application is running, times however many devices the user wishes to be connected to while in the app). I won't be spawning a new thread for every task the user wishes to ask a remote device to do.
    This is why (I think) I need bi-directional messaging between the main thread and each of these threads dedicated to a given remote device that we have an active session with/connection to. The main thread needs to be able to tell remote device X (which already has a running thread dedicated to it) to do task A, and then get real-time feedback from that remote device so that the main thread can be displaying it to the user as it is coming back. Same with remote device Y running task B, simultaneously. At any time during the execution of these tasks, the user needs to be able to tell my app to stop one of these tasks, and the main thread needs to send that message to one of the remote devices via that device's dedicated thread.
    This is why I am talking about this in terms of the "actor model," and not the "worker thread model," because the former model seems to fit what I want to do.
    -- Nathan

  • How to Create and Use MQ Adapter(IBM MQ Series) in BPEL

    Hi,
    I am using Oracle SOA Suite 10.1.3.3.
    I am very new to the Usage of MQ Adapter(IBM MQ Series) in BPEL.
    what is the procedure to create our own Message Queues(i.e., MQ Series)?
    It would be great if anybody share the idea of how to create the MQ and usage of same in BPEL Workflows.
    is it mandatory to install websphere to create the MQ?
    If possible,share the related docs for the same.
    Any suggestions/views will be great.
    Cheers,
    Balaji
    Edited by: user580285 on Nov 4, 2008 5:44 AM

    Hi,
    Kindly refer to the BPEL Dev Guide and in that please refer to the Appendix which contains MQ Series Adapter.
    For this you need to provide the details like: -
    MQ Server Host, port, queue manager name etc. Also you need not to install IBM Websphere MQ, you can work on it remotely as well.

  • Need help about setting up a JMS sender channel

    I just started to play with PI for a few weeks and I'm trying to setup a simple JMS sender channel to read stuff from a WebSphere MQ.
    I've someone installed JMS adaptor for me, but we never know it is correctly installed or not. First question is "Is there any way we can verify JMS adapter is correctly installed or not?"
    In the Design: integration builder, I've a very defined a very simple data type(src_dt) which is a string and a message type(src_mt) which uses resp_dt. Finally I created a message interface (test_mia_out) that contains src_mt. At this point of time, I don't need message mapping so I didn't configurate this section.
    Then I went to Configuration: Integration builder and created a new communcation channel with the following setting:
    Parameter section:
    Adapter Type: JMS
    Transport Protocol: WebSphereMQ (Non-JMS)  <- if i don't use this option, i can't enter MQ connection detail in the Source section.
    Message Protocol: JMS 1.x
    Adapter Engine: Integration Server
    Source section:
    QueueConnectionFactory Java Class: com.ibm.mq.jms.MQQueueConnectionFactory
    Queue Java Class: com.ibm.mq.jms.MQQueue
    ...MQ connection detail...(IP, Port, Queue Manager, Channel and Queue Name )
    Transport Protocol: TCP/IP  <- this is consists to server side setting
    JMS-Compliant: JMS-Compliant
    Since I only want a very simple working sample, again I didn't change the content in receiver determination, interface determaintion and sender agreement.
    Now when I active this change and I saw the following error in the channel monitor:
    Short Log - Channel has internal error
    Admin Info - Exception: Channel with Status Unknown or Not Registered
    I did stop and start the service, refresh CPA cache and even restart the entire PI server, I always see this message and cannot find any more detail description about what is causing this problem.
    My PI Server version is 7.0 and MQ version is 5.3
    There's very limited resource about how to setup to read MQ message in PI and I'm stuck now. Therefore, I need a help from some experienced people to tell me if I have did something wrong or missed some steps?
    And if possible, could people mind to post a step by step go through how you setup it up?
    Edited by: Robert Fu on Jan 10, 2008 6:51 AM

    Before you use the JMS, you need to deploy some drivers related to specific MQseries, Kindly ensure that proper driver are deployed....
    If you use MQSeries 53x.xxx, you must enter the following JAR files in aii_af_jmsproviderlib.sda.
    com.ibm.mq.jar, com.ibm.mqbind.jar, com.ibm.mqjms.jar, connector.jar (use the JAR file from the J2EE client directory)
    check this link it will give you more inofmration
    http://help.sap.com/saphelp_nw04/helpdata/en/cd/d85a9d6fab7d4dbb7ae421f710626c/content.htm
    check this to get the condifuration the JMS
    How to use conversion modules in JMS - https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f02d12a7-0201-0010-5780-8bfc7d12f891
    Ref How To Use the Content Conversion Module in JMS Adapter - https://websmp106.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000582377&

  • WPS54GU2 printing to parallel printer with Windows 7 64-bit-cannot get it to work for the life of me

    Hello,
    I am having the worst difficulties getting the WPS54GU2 to print to a HP Laserjet 4L printer. I know that the general communication is working as I am able to print a test page from the 
    I have the IP address correct for the print server (in my case it is 192.168.1.103) and is set statically in the print server setup.
    I have it working fine on an XP box The port name configured on the XP machine is LK89A0B5_P1.
    The software that comes with the WPS print server will not install on Windows 7 so the address/port/queue must
    be set up manually.
    I have tried the link from Cisco's KB that shows how to configure the print sever:
    http://www6.nohold.net/Cisco2/ukp.aspx?vw=1&docid=69efd80e2ea44d948fea2365d3e0c9eb_Configuring_TCP_I...
    however this does not work and the print job either gets stuck in the print queue, or it shows busy/error in the print queue.
    I have also tried suggestions on this forum that say not to create a TCP/IP port but instead use LPR port.
    Can someone please give me the solution that will work. I have heard people say to use L1 for the queue name, or P1, or LP1
    or lp1. I cannot spend much more time on this before I give up and look for a different print server that will work with both parallel and USB printers.
    Thanks for help/suggestions on this.
    Mike

    sometimes it needs the device- specific drivers to get it to work; especially that you have a 64- bit OS.
    the print server is already connected to the network, right? what is its IP address? check if the computer can ping that IP by going to start> search> cmd> ping 192.168.1.78 (change this to the correct IP address). if your computer can ping the print server then you can setup LPR printing to get your printing jobs done. click on the link below for more info.
    Setting up LPR Printing on Windows 7

  • Java NIO client

    I need to make the server is able to hold about 500 connections and operates on a single thread. The server itself should make all the connections. Where can I find examples of finished implementations?

    I have an example, but it does not work
    import java.io.IOException;
    import java.net.InetAddress;
    import java.net.InetSocketAddress;
    import java.net.Socket;
    import java.nio.ByteBuffer;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.SocketChannel;
    import java.nio.channels.spi.SelectorProvider;
    import java.util.*;
    public class NioClient implements Runnable {
         // The host:port combination to connect to
         private InetAddress hostAddress;
         private String host;
         private int port;
         // The selector we'll be monitoring
         private Selector selector;
         // The buffer into which we'll read data when it's available
         private ByteBuffer readBuffer = ByteBuffer.allocate(8192);
         // A list of PendingChange instances
         private List pendingChanges = new LinkedList();
         // Maps a SocketChannel to a list of ByteBuffer instances
         private Map pendingData = new HashMap();
         // Maps a SocketChannel to a RspHandler
         private Map rspHandlers = Collections.synchronizedMap(new HashMap());
         public NioClient() {
              try {this.selector = this.initSelector();} catch(IOException e){}
         public void connect(String host, int port, RspHandler handler) throws IOException {
              this.hostAddress = hostAddress;
              this.host = host;
              this.port = port;
              this.send("$Hello |".getBytes(), handler);
         public void send(byte[] data, RspHandler handler) throws IOException {
              // Start a new connection
              SocketChannel socket = this.initiateConnection();
              // Register the response handler
              this.rspHandlers.put(socket, handler);
              // And queue the data we want written
              synchronized (this.pendingData) {
                   List queue = (List) this.pendingData.get(socket);
                   if (queue == null) {
                        queue = new ArrayList();
                        this.pendingData.put(socket, queue);
                   queue.add(ByteBuffer.wrap(data));
              // Finally, wake up our selecting thread so it can make the required changes
              this.selector.wakeup();
              handler.waitForResponse();
         public void run() {
              while (true) {
                   try {
                        // Process any pending changes
                        synchronized (this.pendingChanges) {
                             Iterator changes = this.pendingChanges.iterator();
                             while (changes.hasNext()) {
                                  ChangeRequest change = (ChangeRequest) changes.next();
                                  switch (change.type) {
                                  case ChangeRequest.CHANGEOPS:
                                       SelectionKey key = change.socket.keyFor(this.selector);
                                       key.interestOps(change.ops);
                                       break;
                                  case ChangeRequest.REGISTER:
                                       change.socket.register(this.selector, change.ops);
                                       break;
                             this.pendingChanges.clear();
                        // Wait for an event one of the registered channels
                        this.selector.select();
                        // Iterate over the set of keys for which events are available
                        Iterator selectedKeys = this.selector.selectedKeys().iterator();
                        while (selectedKeys.hasNext()) {
                             SelectionKey key = (SelectionKey) selectedKeys.next();
                             selectedKeys.remove();
                             if (!key.isValid()) {
                                  continue;
                             // Check what event is available and deal with it
                             if (key.isConnectable()) {
                                  this.finishConnection(key);
                             } else if (key.isReadable()) {
                                  this.read(key);
                             } else if (key.isWritable()) {
                                  this.write(key);
                   } catch (Exception e) {
                        e.printStackTrace();
         private void read(SelectionKey key) throws IOException {
              SocketChannel socketChannel = (SocketChannel) key.channel();
              // Clear out our read buffer so it's ready for new data
              this.readBuffer.clear();
              // Attempt to read off the channel
              int numRead;
              try {
                   numRead = socketChannel.read(this.readBuffer);
              } catch (IOException e) {
                   // The remote forcibly closed the connection, cancel
                   // the selection key and close the channel.
                   key.cancel();
                   socketChannel.close();
                   return;
              System.out.println("READ");
              if (numRead == -1) {
                   // Remote entity shut the socket down cleanly. Do the
                   // same from our end and cancel the channel.
                   key.channel().close();
                   key.cancel();
                   return;
              // Handle the response
              this.handleResponse(socketChannel, this.readBuffer.array(), numRead);
         private void handleResponse(SocketChannel socketChannel, byte[] data, int numRead) throws IOException {
              // Make a correctly sized copy of the data before handing it
              // to the client
              byte[] rspData = new byte[numRead];
              System.arraycopy(data, 0, rspData, 0, numRead);
              // Look up the handler for this channel
              RspHandler handler = (RspHandler) this.rspHandlers.get(socketChannel);
              // And pass the response to it
              if (handler.handleResponse(rspData)) {
                   // The handler has seen enough, close the connection
                   socketChannel.close();
                   socketChannel.keyFor(this.selector).cancel();
         private void write(SelectionKey key) throws IOException {
              SocketChannel socketChannel = (SocketChannel) key.channel();
              synchronized (this.pendingData) {
                   List queue = (List) this.pendingData.get(socketChannel);
                   // Write until there's not more data ...
                   while (!queue.isEmpty()) {
                        ByteBuffer buf = (ByteBuffer) queue.get(0);
                        socketChannel.write(buf);
                        if (buf.remaining() > 0) {
                             // ... or the socket's buffer fills up
                             break;
                        queue.remove(0);
                   if (queue.isEmpty()) {
                        // We wrote away all data, so we're no longer interested
                        // in writing on this socket. Switch back to waiting for
                        // data.
                        key.interestOps(SelectionKey.OP_READ);
         private void finishConnection(SelectionKey key) throws IOException {
              SocketChannel socketChannel = (SocketChannel) key.channel();
              // Finish the connection. If the connection operation failed
              // this will raise an IOException.
              try {
                   socketChannel.finishConnect();
              } catch (IOException e) {
                   // Cancel the channel's registration with our selector
                   System.out.println(e);
                   key.cancel();
                   return;
              // Register an interest in writing on this channel
              key.interestOps(SelectionKey.OP_WRITE);
         private SocketChannel initiateConnection() throws IOException {
              // Create a non-blocking socket channel
              SocketChannel socketChannel = SocketChannel.open();
              socketChannel.configureBlocking(false);
              // Kick off connection establishment
              socketChannel.connect(new InetSocketAddress(this.host, this.port));
              // Queue a channel registration since the caller is not the
              // selecting thread. As part of the registration we'll register
              // an interest in connection events. These are raised when a channel
              // is ready to complete connection establishment.
              synchronized(this.pendingChanges) {
                   this.pendingChanges.add(new ChangeRequest(socketChannel, ChangeRequest.REGISTER, SelectionKey.OP_CONNECT));
              return socketChannel;
         private Selector initSelector() throws IOException {
              // Create a new selector
              return SelectorProvider.provider().openSelector();
    public class RspHandler {
         private byte[] rsp = null;
         public synchronized boolean handleResponse(byte[] rsp) {
              this.rsp = rsp;
              this.notify();
              return true;
         public synchronized void waitForResponse() {
              while(this.rsp == null) {
                   try {
                        this.wait();
                   } catch (InterruptedException e) {
              System.out.println(new String(this.rsp));
    }          NioClient NioClient = new NioClient();
              Thread t = new Thread(NioClient);
              t.setDaemon(true);
              t.start();
              RspHandler handler = new RspHandler();          
              NioClient.connect("69.28.156.250", 27040, handler);
              NioClient.connect("72.165.61.188", 27040, handler);
              NioClient.connect("208.111.133.84", 27011, handler);
              NioClient.connect("72.165.61.136", 27012, handler);
    Edited by: 915967 on 01.08.2012 7:07

  • How do I get an MQSeries client working...

    It seems I can never get my head round IBM products. MQSeries has proven to be no exception! Perhaps there's a conspiracy to keep PS in work? ;)
    Anyway, gripes aside, I've been trying to get a Java client to talk to a remote MQSeries server.
    I've downloaded MA88 and included a minimal set of JARs on my classpath (com.ibm.mq.jar and j2ee.jar) and have attempted to connect to the server using the following code (adapted from an IBM sample):
         public MQSeriesTest(String server, int port, String queueManager, String channel, String queue)
              MQEnvironment.hostname = server;
              MQEnvironment.port = port;
              MQEnvironment.channel = channel;
              MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);
              this.queueManagerName = queueManager;
              this.queueName = queue;
         public void sendTestMessage() throws Exception
              MQQueueManager queueManager = new MQQueueManager(queueManagerName);
              MQQueue queue = queueManager.accessQueue(queueName, MQC.MQOO_OUTPUT);
              MQMessage message = new MQMessage();
              message.writeUTF("This is a test message from Java");
              queue.put(message);
              queueManager.disconnect();
         }However, all I get back is this:
    Unable to load message catalog - mqji
    com.ibm.mq.MQException:  Message catalog not found
         at com.ibm.mq.MQManagedConnectionJ11.<init>MQManagedConnectionJ11.java:171)Other attempts to connect have led to a connection failure with reason code 2009.
    The furthest I've managed to get on the IBM site is to resolve this to "bad configuration"
    I am informed by the MQSeries administrator that my server, port, queue manager name, queue name and channel name are all correct.
    Is there anyone out there who can spot what I'm doing wrong here?
    Thanks.

    I had the same error message when I tried to acces local queue on remote server. I had NO problem accessing local queue on local server. I believe that the MQC.TRANSPORT_MQSERIES_CLIENT is the key for this problem. I share this code as a copy-paste one from my repository. Hope this helps.
    import java.io.IOException;
    import java.util.Date;
    import javax.jms.TextMessage;
    import com.ibm.mq.MQC;
    import com.ibm.mq.MQEnvironment;
    import com.ibm.mq.MQException;
    import com.ibm.mq.MQMessage;
    import com.ibm.mq.MQPutMessageOptions;
    import com.ibm.mq.MQQueue;
    import com.ibm.mq.MQQueueManager;
    * This class is for encapsulate the MQ related functionality. (Sorry for System.out, you'd use log4j instead or java.util.logging; its an example anyway)
    * @author [email protected]
    public class MQ {
         String manager;
         String queue;
          * You should use the specific constructor.
         private MQ() {
         public static void main(String[] g) throws IOException {
              MQ mq = new MQ("sampleQueueManager", "mq_sample_queue");
              mq.send("test-ok-" + new Date());
          * You should specify the manager and the queue name in order to have
          * connected.
          * @param managerName
          *            the name of the queue manager.
          * @param queueName
          *            the name of the queue to use for message send.
         public MQ(String managerName, String queueName) {
              this.manager = managerName;
              this.queue = queueName;
          * Sends a composed XML message as text message to the given queue.
          * @param xml
          *            the xml file to send.
          * @throws IOException
          *             in case of io exception (e.g. message max. size exceeeded) or
          *             if JMS exception was thrown inside.
         public void send(String xml) throws IOException {
              try {
                   String hostname = "localhost"; // or the name of the remote server
                   String channel = "SYSTEM.DEF.SVRCONN"; // or the server connection you have defined
                   int port = 1414; // this is the default one
                   int CCSID = 437; // in US/UK you should use this, 852 fine for Hungary. This value can be investigated on the server (queue manager, properrties, general
                   System.out.println("setting up MQ");
                   if (hostname != null) {
                        System.out.println("hostname set to " + hostname);
                        MQEnvironment.hostname = hostname;
                        MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES_CLIENT);
                   if (channel != null) {
                        System.out.println("channel set to " + channel);
                        MQEnvironment.channel = channel;
                   if (port != 0) {
                        System.out.println("port set to " + port);
                        MQEnvironment.port = port;
                   if (CCSID != 0) {
                        System.out.println("CCSID set to " + CCSID);
                        MQEnvironment.CCSID = CCSID;
                   System.out.println("MQmanager");
                   MQQueueManager qMgr = new MQQueueManager(manager);
                   int openOptions = MQC.MQOO_OUTPUT;
                   System.out.println("MQmanager-access queue");
                   MQQueue q = qMgr.accessQueue(queue, openOptions, null, null, null);
                   MQPutMessageOptions pmo = new MQPutMessageOptions();
                   pmo.options = MQC.MQPMO_NONE;
                   MQMessage mBuf = new MQMessage();
                   mBuf.clearMessage();
                   mBuf.correlationId = MQC.MQCI_NONE; // this acts as filter when you browse the queue!
                   mBuf.messageId = MQC.MQMI_NONE; // if MQMI not set, so everyone can use the queue
                   mBuf.writeString(xml);
                   System.out.println("put message to queue");
                   q.put(mBuf, pmo);
                   System.out.println("about to close");
                   q.close();
                   qMgr.disconnect();
              } catch (MQException x) {
                   // I don't think it is usefull for others to handle the MQException
                   // outside this class however they need to know that the operation
                   // failed.
                   throw new IOException(
                             "Connection to MQSeries is broken on queue(manager/channel)@host:port\n"
                                       + queue + "(" + manager + "/"
                                       + MQEnvironment.channel + ")@"
                                       + MQEnvironment.hostname + ":" + MQEnvironment.port);
    }

  • Messaging Bridge with MQ using SSL

    Hi everybody,
    I'm using JMS messaging bridge to transfer messages from WLS 10.3.6 running on a Solaris machine to remote WebSphere MQ 7 running on an AIX machine. Weblogic reads the configuration of remote MQ from a text file, called .bindings, created using the MQ JMSAdmin tool. The file defines a connection factory with the IP address, port, queue and queue manager name and other important definitions of the remote MQ.
    The thing is that the bridge starts pretty well and transfer messages normally, but I need to change the configuration to use SSL. To do it I just added the parameter SSLCIPHERSUITE(SSL_RSA_WITH_RC4_128_MD5) and thought it was enough to achieve the goal.
    <May 12, 2014 3:05:45 PM BRT> <Debug> <MessagingBridgeRuntimeVerbose> <BEA-000000> <Exception:
    com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2009
    MQJE016: MQ queue manager closed channel immediately during connect
    Closure reason = 2009
    Wondering the error could be relatedo to an SSL exception, I enabled the SSL debugging (-Dssl.debug=true) to the managed server, but there were no evidences of an SSL handshake of Weblogic and MQ, so there is no SSL communication between the peers.
    Does anybody know if this kind of communication is feasible? What may I be missing here?
    Tks!

    Hi everybody,
    I'm using JMS messaging bridge to transfer messages from WLS 10.3.6 running on a Solaris machine to remote WebSphere MQ 7 running on an AIX machine. Weblogic reads the configuration of remote MQ from a text file, called .bindings, created using the MQ JMSAdmin tool. The file defines a connection factory with the IP address, port, queue and queue manager name and other important definitions of the remote MQ.
    The thing is that the bridge starts pretty well and transfer messages normally, but I need to change the configuration to use SSL. To do it I just added the parameter SSLCIPHERSUITE(SSL_RSA_WITH_RC4_128_MD5) and thought it was enough to achieve the goal.
    <May 12, 2014 3:05:45 PM BRT> <Debug> <MessagingBridgeRuntimeVerbose> <BEA-000000> <Exception:
    com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2009
    MQJE016: MQ queue manager closed channel immediately during connect
    Closure reason = 2009
    Wondering the error could be relatedo to an SSL exception, I enabled the SSL debugging (-Dssl.debug=true) to the managed server, but there were no evidences of an SSL handshake of Weblogic and MQ, so there is no SSL communication between the peers.
    Does anybody know if this kind of communication is feasible? What may I be missing here?
    Tks!

  • JMS in RAD 6

    I have created a JMS client (programatically) in RAD V6 by using all the properties HOST,Port,queue connection factory.
    INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory
    Server is in different machine.
    I am able to createqueque connection and also session , input and output queues ,When i try to send the message I get error message:
    [1/24/07 14:20:44:045 EST] 0000002e WASLogger E CLASSNAME METHODNAME an
    internal error has occurred. Please contact your system administrator.
    Detail: com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2019
    [1/24/07 14:20:44:061 EST] 0000002e SystemOut O Exception in method
    QueueSend.sendMessage()MQJMS2007: failed to send message to MQ queue
    [1/24/07 14:20:44:061 EST] 0000002e SystemErr R javax.jms.JMSException:
    MQJMS2007: failed to send message to MQ queue
    at
    com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:553)
    The same code (with same configuration) works fine in WSAD 4.
    Do i need to do any configuration in RAD V6?
    Can u someone help on this?

    Check the configurations of the JMS Destinations in
    both of the cases.
    Your JMS destination "Time to Live" value may be
    overriding the value passed as a parameter.
    So check and confirm that values on both of the
    servers are same.I should've mentioned that I checked that the "time to live" override values are set to the default (-1) value. A value of -1 should mean that the destination is not overriding any programmatically specified value, right? Thanks for the help, though.

  • JMS Service

    Greetings everyone,
    I'm needing to configure a JMS Service for a process, but all of the connection options the JMS Service properties gives me leaves me without connection information, ports, Queue names, Channels, etc.  Where can I setup the connection to specify the hostname, channel, usernames, and password?
    Thank you,
    Alex

    Update:
    The information I have to work with is the following:
    Queue Name
    QueueManager
    TransportType
    Hostname
    Port
    Channel
    Username
    Password
    I set my process to short-lived with propagation disabled.  Supposedly the Websphere Queue is sitting on a different server than the livecycle server, so when I try to change the initial context factory, it doesn't display a list of connection factories in the process' JMS properties.
    Any help would be very appreciated!

  • Which Switch to get 3560vs3750vs2960 or better?

    We are currently running two stacked 2960-s switches that is conecting our SAN to our netgear access switches. We our currently looking into either replacing the 2960s with 3560 or 3750. Has anyone delt with these models before and can give me a realworld overview to help us make our decision. We would also like to be prepared for future deployment of VoIP.

    Disclaimer
    The Author of this posting offers the information contained within this posting without consideration and with the reader's understanding that there's no implied or expressed suitability or fitness for any purpose. Information provided is for informational purposes only and should not be construed as rendering professional advice of any kind. Usage of this posting's information is solely at reader's own risk.
    Liability Disclaimer
    In no event shall Author be liable for any damages whatsoever (including, without limitation, damages for loss of use, data or profit) arising out of the use or inability to use the posting's information even if Author has been advised of the possibility of such damage.
    Posting
    Since my original posting, I had to deal with a 3750X dropping packets like crazy with QoS enabled and hosting SAN devices.
    I was able to tune the buffer settings to obtain performance even better than with QoS disabled; got the drop rate almost to zero.
    My approach was to not reserve buffers (i.e. let the common pool have them), set thresholds to maximum (maximum increased on later IOS versions), and increase buffer allocation to the queue suffering drops (in my instance, the default class).
    Basically, one port queue could then take all the buffer space on the ASIC.
    In my case, my problem was transient congestion on just a couple of ports, not a huge amount of contention between ports.
    Also on the 3750X, there's 2 MB of buffer space per 24 edge ports or per 4 uplink ports, so host placement can be important too.

Maybe you are looking for

  • Warning messages (Moving from JDK1.4 to DJK1.5)

    I got some warning messages after I moved from 1.4 to 1.5, can someone show me the right way to avoid them ? ===================================================================== Scanner.java:909: warning: [unchecked] unchecked call to add(E) as a me

  • Updating Acrobat Pro 9.0

    I had to reinstal Acrobat 9.0 in my Windows 8.1 desktop.  It seems like a firewall issue but I cannot figure out how to allow it through the firewall if so.  Thanks.

  • Osx Lion Restore Problems

    So I decided to restore my new 2011 21.5 inch imac back to osx lion, I decided this because apparently my macintosh hd wont let my partition it in anyway and i cant put windows on here unless I do a fresh install of lion, then I can do boot camp. So

  • DVD is stuck!

    I was watching a DVD on my iBook and all of a sudden..the movie froze..so I had to shut down my iBook. After I logged back on I noticed the DVD wasn't being recognized by the computer..I tried pressing the F12 eject button and nothing happens. Not ev

  • Application server as win service

    hello! i have a question regarding the oracle internet application server: i installed iAS_101330_Apache2_Modplsql2_win32 on windows 2003 server. is it possible to run the oracle apache as service (opmnctl is not installed as service)? if yes, how? t