-1

I would like to build a Spring Boot 2 application with spring integration http support. But I cant find the int-http namespache.

My Xml:

<int-http:outbound-gateway id="quakerHttpGateway"
     request-channel="quakeinfotrigger.channel"
     url="http://..."
     http-method="GET"
     expected-response-type="java.lang.String"
     charset="UTF-8"
     reply-timeout="5000"
     reply-channel="quakeinfo.channel">     
 </int-http:outbound-gateway>

Gradle:

buildscript {
    ext {
        springBootVersion = '2.0.0.M7'
    }
    repositories {
        mavenCentral()
        maven { url "https://repo.spring.io/snapshot" }
        maven { url "https://repo.spring.io/milestone" }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
    }
}

apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

group = 'myCompany'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/milestone" }
}


dependencies {
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.boot:spring-boot-starter-integration')
    compile('org.springframework.integration:spring-integration-http')
    compile('org.codehaus.groovy:groovy')
    runtime('com.h2database:h2')
    testCompile('org.springframework.boot:spring-boot-starter-test')
}

enter image description here

Michael Hegner
  • 5,555
  • 9
  • 38
  • 64

1 Answers1

0

You should show xsi:schemaLocation definition in the beginning of your XML config and of course demonstrate and exception. Since this is Spring Boot app that also would be great to have shared its simple version somewhere on GitHub to let us to download it locally and play.

Also keep in mind that Eclipse doesn't resolve XSDs from the classpath by default, you need enable Spring Nature or start to use Spring compatible IDE. (If that is the case of IDE, not runtime problem).

Since you use the proper org.springframework.integration:spring-integration-http dependency, the XSD is there, in that jar. Only what you need to keep in mind there that we recommend "versionless" schema definitions or just use the version of the jar you depend on (minor version). With Spring Boot 2.0 it is 5.0: https://docs.spring.io/spring-integration/docs/5.0.0.RELEASE/reference/htmlsingle/#configuration-namespace

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118
  • Hi Artem, thank you for reply. The Project has Spring Nature, but there is no namespace for int-http to select. I dont know, why it doesnt show up, I am using STS 3.9.2 – Michael Hegner Jan 10 '18 at 18:48
  • Not sure what you show there, but you indeed have to add `int-http` definition to the head of your XML config: https://docs.spring.io/spring-integration/docs/5.0.0.RELEASE/reference/html/http.html#http-namespace – Artem Bilan Jan 10 '18 at 18:50
  • IIRC, If you add a dependency while the file is open, the new namespace won't show up until you close/reopen the XML. – Gary Russell Jan 10 '18 at 18:51
  • Hi Gary, I reopened it, I restarted STS, it doesnt show up... I renew workspace now ... – Michael Hegner Jan 10 '18 at 18:57
  • For me it looks like, that the editor doesnt work proper, I copied the part of xml as you suggested Artem, but it is not showing up in the Namespaces list, where you normally can select it. – Michael Hegner Jan 10 '18 at 19:17
  • As I said in the comment above: you have to add `int-http` declaration into that XML. Right now you just don't have it... – Artem Bilan Jan 10 '18 at 19:17
  • Looks like IDE problem. Try to reinstall it or otherwise report the issue against STS project. – Artem Bilan Jan 10 '18 at 19:18
  • I updated STS from 3.9.0 till now 3.9.2. Maybe something went wrong between that. I will try a fresh STS, if that doesnt help I will report it. Thanks for your time. – Michael Hegner Jan 10 '18 at 19:33