Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RabbitMQ configuration failure with version 1.5.0.RELEASE for service registery #15

Closed
avirkar opened this issue Nov 15, 2017 · 5 comments

Comments

@avirkar
Copy link

avirkar commented Nov 15, 2017

My application uses the 1.5.0.RELEASE for service registry depencency. Whenever I deploy the application to PCF the application is unable to create any exchange or queues. It works well with 1.4.0.RELEASE so i think something in the latter release is breaking it. I also noticed that having the connection params for rabbit (host, port, virtualhost, username, password) in the user provided environment variables resolves the issue but that is not the right way to do it.

<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-amqp</artifactId> </dependency>

<dependency> <groupId>io.pivotal.spring.cloud</groupId> <artifactId>spring-cloud-services-starter-service-registry</artifactId> <version>1.5.0.RELEASE</version> </dependency>

@avirkar avirkar changed the title RabbitMQ configuration failure with version service registery 1.5.0.RELEASE RabbitMQ configuration failure with version 1.5.0.RELEASE for service registery Nov 15, 2017
@scottfrederick
Copy link
Member

@avirkar Please share the full <dependencies> and <dependencyManagement> sections from your pom.xml so we can see the versions of Spring Boot, Spring Cloud, and Spring Cloud Services libraries you are using. There might be an issue with the compatibility of the versions being used. See the Spring Cloud Services docs for the recommended dependencies configuration.

It would also be helpful to see the VCAP_SERVICES JSON for the app that is trying to use the service registry and RabbitMQ service (with credentials redacted as necessary).

@avirkar
Copy link
Author

avirkar commented Nov 17, 2017

The following is my pom file. `

4.0.0

<name></name>
<description></description>

<parent>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-parent</artifactId>
	<version>1.5.7.RELEASE</version>
	<relativePath/> <!-- lookup parent from repository -->
</parent>

<properties>
	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
	<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
	<java.version>1.8</java.version>
	<axon.version>3.0.6</axon.version>
	<logback.version>1.2.3</logback.version>
	<logstash-logback-encoder.version>4.11</logstash-logback-encoder.version>
	<swagger.version>2.7.0</swagger.version>
	<ehcache.version>2.8.3</ehcache.version>
	<cucumber.version>1.2.5</cucumber.version>
	<commons-io.version>2.5</commons-io.version>
	<!-- Test -->
	<qpid-broker.version>6.1.4</qpid-broker.version>
	<!-- Common -->
	<preopen.common.version>1.0.0</preopen.common.version>
</properties>

<dependencies>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-data-mongodb</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-data-rest</artifactId>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-web</artifactId>
	</dependency>
	<!-- AMQP -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-amqp</artifactId>
	</dependency>

	<!-- Actuators -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-actuator</artifactId>
	</dependency>

	<!-- Spring Boot Security -->

	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-security</artifactId>
	</dependency>

	<!-- Spring Context Support -->
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-context-support</artifactId>
	</dependency>

	<!-- Pivotal Spring Cloud Service Registry -->
	<dependency>
		<groupId>io.pivotal.spring.cloud</groupId>
		<artifactId>spring-cloud-services-starter-service-registry</artifactId>
		<version>1.4.0.RELEASE</version>
	</dependency>

	<!-- Eh Cache <dependency> <groupId>net.sf.ehcache</groupId> <artifactId>ehcache</artifactId>
		<version>${ehcache.version}</version> </dependency> -->

	<!-- Tests -->
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-starter-test</artifactId>
		<exclusions>
			<exclusion>
				<groupId>com.vaadin.external.google</groupId>
				<artifactId>android-json</artifactId>
			</exclusion>
		</exclusions>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework.boot</groupId>
		<artifactId>spring-boot-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.springframework</groupId>
		<artifactId>spring-test</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>commons-io</groupId>
		<artifactId>commons-io</artifactId>
		<version>${commons-io.version}</version>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>junit</groupId>
		<artifactId>junit</artifactId>
		<scope>test</scope>
	</dependency>
	<dependency>
		<groupId>org.apache.qpid</groupId>
		<artifactId>qpid-broker</artifactId>
		<version>${qpid-broker.version}</version>
		<scope>test</scope>
		<exclusions>
			<exclusion>
				<groupId>org.apache.geronimo.specs</groupId>
				<artifactId>geronimo-servlet_3.0_spec</artifactId>
			</exclusion>
		</exclusions>
	</dependency>


	<!-- Others -->

	<!-- Lombok -->
	<dependency>
		<groupId>org.projectlombok</groupId>
		<artifactId>lombok</artifactId>
		<scope>provided</scope>
	</dependency>

	<!-- SLFJ -->
	<dependency>
		<groupId>org.slf4j</groupId>
		<artifactId>slf4j-api</artifactId>
	</dependency>

	<!-- Jackson -->
	<dependency>
		<groupId>com.fasterxml.jackson.datatype</groupId>
		<artifactId>jackson-datatype-jsr310</artifactId>
	</dependency>

	<!-- Logback -->

	<dependency>
		<groupId>net.logstash.logback</groupId>
		<artifactId>logstash-logback-encoder</artifactId>
		<version>${logstash-logback-encoder.version}</version>
	</dependency>

	<!-- Swagger -->

	<dependency>
		<groupId>io.springfox</groupId>
		<artifactId>springfox-swagger2</artifactId>
		<version>${swagger.version}</version>
	</dependency>
	<dependency>
		<groupId>io.springfox</groupId>
		<artifactId>springfox-swagger-ui</artifactId>
		<version>${swagger.version}</version>
	</dependency>


</dependencies>

<dependencyManagement>
	<dependencies>
		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-dependencies</artifactId>
			<version>Camden.SR7</version>
			<type>pom</type>
			<scope>import</scope>
		</dependency>
	</dependencies>
</dependencyManagement>


<build>
	<finalName>${project.artifactId}</finalName>
	<plugins>
		<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
		</plugin>

		<plugin>
			<groupId>pl.project13.maven</groupId>
			<artifactId>git-commit-id-plugin</artifactId>
		</plugin>
	</plugins>

</build>
`

@scottfrederick
Copy link
Member

@avirkar The first thing to try is to remove the <version> element from this block:

	<dependency>
		<groupId>io.pivotal.spring.cloud</groupId>
		<artifactId>spring-cloud-services-starter-service-registry</artifactId>
		<version>1.4.0.RELEASE</version>
	</dependency>

and add this block to the <dependencyManagement> section:

            <dependency>
                <groupId>io.pivotal.spring.cloud</groupId>
                <artifactId>spring-cloud-services-dependencies</artifactId>
                <version>1.4.0.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

If you change the spring-cloud-services-dependencies version from 1.4.0.RELEASE to 1.5.0.RELEASE, you could try to also change the spring-cloud-dependencies from Camden.SR7 to Dalston.SR4 to see if you are running into version compatibility problems.

@pavax
Copy link

pavax commented Jan 31, 2018

I have the same problem. Looks like it's caused by

io.pivotal.spring.cloud.config.java.ServiceInfoPropertySourceAdapter.java (1.6.1)

I created a sample project: https://github.com/pavax/cloudfoundry-sample

deploy it and go to the /management/env Actuator Endpoint (username: root / password: secret)

you'll find

springCloudServicesRabbitAutoconfigExcluder: {
spring.autoconfigure.exclude: "org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration"
},

@spikymonkey
Copy link
Contributor

Thanks for the report @avirkar, and for the follow-up @pavax. As you say, this seems to be an issue in the connector, so I'm going to close this issue in favour of pivotal-cf/spring-cloud-services-connector#36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants