Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8228419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:27:01+00:00 2026-06-07T16:27:01+00:00

Can any one suggest me code to write a message driven bean in C#.net

  • 0

Can any one suggest me code to write a message driven bean in C#.net to listen a MQ and process the same.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T16:27:02+00:00Added an answer on June 7, 2026 at 4:27 pm

    XMS will be pretty similar to JMS. This is a “hello, world” example of a message listener in C# using XMS. Please include the reference IBM.XMS.dll from your websphere mq installation.

    On my windows installation, 32bit, it was

    c:\Program Files\IBM\WebSphere MQ\bin\IBM.XMS.dll
    

    This sample assumes a few hardcoded settings and have no error handling, but I think you get the idea.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using IBM.XMS;
    
    namespace XMSTest
    {
        class MyXmsApp
        {
            static void Main(string[] args)
            {
                MyXmsApp app = new MyXmsApp();
                app.Setup();
                Console.ReadLine();
            }
    
            public void Setup()
            {
                XMSFactoryFactory xff = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
                IConnectionFactory cf = xff.CreateConnectionFactory();
                cf.SetStringProperty(XMSC.WMQ_HOST_NAME, "localhost");
                cf.SetIntProperty(XMSC.WMQ_PORT, 1414);
                cf.SetStringProperty(XMSC.WMQ_CHANNEL, "CLIENT");
                cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
                cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "QM_LOCAL");
                cf.SetIntProperty(XMSC.WMQ_BROKER_VERSION, XMSC.WMQ_BROKER_V1);
    
                IConnection conn = cf.CreateConnection();
                Console.WriteLine("connection created");
                ISession sess = conn.CreateSession(false, AcknowledgeMode.AutoAcknowledge);
                IDestination dest = sess.CreateQueue("queue://q");
                IMessageConsumer consumer = sess.CreateConsumer(dest);
                MessageListener ml = new MessageListener(OnMessage);
                consumer.MessageListener = ml;
                conn.Start();
                Console.WriteLine("Consumer started");
            }
    
            private void OnMessage(IMessage msg)
            {
                ITextMessage textMsg = (ITextMessage)msg;
                Console.Write("Got a message: ");
                Console.WriteLine(textMsg.Text);
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can any one suggest me the best way to write code for uploading a
Can any one suggest good resources and practice exercises for Teradata and Business Objects
can any one suggest me, how to learn about custom controls in c# for
Can any one suggest me how to play the music using MPMusicPlayerController in my
Can Any one suggest me which is the better approach to work with NSInputStream.
Can any one suggest a good tutorial for Mozilla rhino. What i want to
Can any one suggest me a lightbox jquery which supports .avi file??
can anyone suggest me a plugin/tool that can perform a code formatting at build
Actually I am stuck in middle of some mysql code. Can anyone suggest a
Can anyone please suggest me a good sample code for zooming image in NSImageView.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.