Results 1 to 10 of 16

Thread: How to get channel name used in gateway?

Hybrid View

  1. #1
    Join Date
    May 2010
    Posts
    15

    Unhappy How to get channel name used in gateway?

    Code:
    <jms:inbound-gateway id="mindMessageHODXGateway"
    		request-destination="mindQueueHODX" request-channel="mindMessageChannel"
    		error-channel="mindMessageConsumptionErrorChannel" auto-startup="false"
    		extract-request-payload="false" selector="SERVICE='HODX'"
    		request-timeout="-1" />
    it's my gateway configuration.
    Now i can get the gateway instance from the application context.
    It's an instance of 'JmsMessageDrivenEndpoint'.
    But i can't get the channel name used in the instance.
    The name is for me to look up the channel instance in the application context.
    Can somebody help me ?

  2. #2
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    635

    Default

    Hello.
    What do you mean about "channel name"?
    Your inbound-gateway must read JMS-message from mindQueueHODX and place SI-message into channel mindMessageChannel
    What is the reason about auto-startup="false"?

    Artem
    Last edited by Cleric; Jun 2nd, 2011 at 01:43 AM.

  3. #3
    Join Date
    May 2010
    Posts
    15

    Default

    thanks my friend.
    All that i have to do is to write java code to get the gateway.
    I get the gateway instance by looking up the application context.
    But i can't get the channel name or channel instance the gateway used.
    The reason I have to get the channel is to monitor the message amount in the channel.
    What can i do?

  4. #4
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    635

    Default

    I think it can be like this:
    HTML Code:
     <channel id="mindMessageChannel">
            <queue/>
      </channel>
    And the Java code for reading that channel:
    Code:
    QueueChannel channel = context.getBean("mindMessageChannel", ueueChannel.class);
    channel.getQueueSize();

  5. #5
    Join Date
    May 2010
    Posts
    15

    Default

    hi friend:
    My code is below:
    JmsMessageDrivenEndpoint gateway= context.getBean("mindMessageHODXGateway", JmsMessageDrivenEndpoint.class);

    Because
    I don't know the channel's name .
    I just know the gateway's name .
    I have many gateways , And I just want to get the channel instance through gateway instance

  6. #6
    Join Date
    Jan 2009
    Location
    Ukraine, Kharkov
    Posts
    635

    Default

    What is your SI-config?
    How do you develope application, if you don't know your Spring config?
    I'm confused...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •