Mistre83
Mistre83

Reputation: 2827

Spring Integration - Difference from channel and int:channel

I'm studing by few days Spring Integration and in some example i've noticed the use of channel and int:channel.

What is the difference ?

In the same way, there are other keywords: someone start with int: and other (with the same name) are not.

Upvotes: 0

Views: 761

Answers (1)

Gary Russell
Gary Russell

Reputation: 174729

It just depends on how you configure the namespaces at the top of the XML file, and specifically the default xmlns. In the first case, the integration schema is the default, in the second, something else is, usually beans...

<beans:beans xmlns="http://www.springframework.org/schema/integration"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:beans="http://www.springframework.org/schema/beans" 
    ...

In this case, integration is the default xmlns and you would use

<channel ...

and

<beans:bean ...

here...

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:int="http://www.springframework.org/schema/integration"
    ...

beans is the default xmlns and you would use

<int:channel...

and

<bean ....

So, it's simply a matter of personal choice.

Upvotes: 1

Related Questions