Results 1 to 7 of 7

Thread: int:gateway creates EventDrivenConsumer instead of proxy for my interface

  1. #1
    Join Date
    Jul 2012
    Posts
    5

    Default int:gateway creates EventDrivenConsumer instead of proxy for my interface

    Hi,
    I'm using SI 2.1. I need to create a standard gateway but every time I want to access/inject it the type is EventDrivenConsumer instead of proxy for my interface (as I know SI should use GatewayProxyFactoryBean).

    Code:
        <int:channel id="requestChannel"/>
        
            					
        <oxm:jaxb2-marshaller id="marshaller" contextPath="my_package"/>
        
        <int:gateway id="gateway" 
    				 service-interface="_my_interface_"
    				 default-request-channel="requestChannel">
        </int:gateway>				     
        
        <ws:outbound-gateway id="wsGateway" 
        					 marshaller="marshaller"
        					 unmarshaller="marshaller"
        					 uri="#{wsUrl}" 
        					 request-channel="requestChannel" />
    I've also tried adding a Gateway annotation for my interface but it doesn't work as well.
    PS: I'm pretty sure that all necessary SI jars are in the classpath.

  2. #2
    Join Date
    Jul 2012
    Posts
    5

    Default works with http:outbound-gateway

    I investigated the problem and above configuration works fine with http:outbound-gateway (instead of ws:outbound-gateway). Of course it doesn't solve my problem :| ... just indicates to problematic part

  3. #3
    Join Date
    Jul 2012
    Posts
    5

    Default

    Ok. I know what was the problem. Removed 'id' element of ws:outbound-gateway and it works now. Quite strange :| ... Does anybody know if I should create some bug for this ?

  4. #4
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    The config excerpt you posted has "wsGateway" as a value for the id of the ws:outbound-gateway. Is the actual value of that "gateway"? (thus overwriting the GatewayProxyFactoryBean's id) - If not, can you describe how you are accessing/injecting the bean?

    Thanks,
    Mark

  5. #5
    Join Date
    Jul 2012
    Posts
    5

    Default

    Hi,
    definitely I used different ID but your suggestion is 100% right. As I double checked other XML files. The ID I used for WS outbound-gateway was defined before :| ... so that was the reason. But the main problem is that SI just creates that consumer object instead of throwing an error
    Generally we can close this topic. Thanks a lot for your help

  6. #6
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

    That's the underlying Spring behavior. Ultimately these are just "bean names" and by default in Spring bean names can be overridden (a useful feature when replacing beans for a particular environment, e.g. testing). If you really want an error instead, you can disable bean-overriding at the Spring configuration level.

    Hope that makes sense.
    -Mark

  7. #7
    Join Date
    Jul 2012
    Posts
    5

    Default

    Definitely it makes sense. But on the other hand some extra warning when override not compatible beans would be nice. Generally for overriding I used to use 'alias' but I understand that in many cases the behavior you described is a must-be

    Thanks a lot.

Tags for this Thread

Posting Permissions

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