Coder Social home page Coder Social logo

spring-cloud / spring-cloud-cloudfoundry Goto Github PK

View Code? Open in Web Editor NEW
80.0 36.0 73.0 114.37 MB

Integration between Cloudfoundry and the Spring Cloud APIs

License: Apache License 2.0

Ruby 0.46% Java 99.02% Groovy 0.52%
java spring spring-boot spring-cloud cloudfoundry service-discovery microservices cloud-native ribbon spring-cloud-core

spring-cloud-cloudfoundry's Introduction

Spring Cloud for Cloudfoundry

CircleCI

Spring Cloud for Cloudfoundry makes it easy to run Spring Cloud apps in Cloud Foundry (the Platform as a Service). Cloud Foundry has the notion of a "service", which is middlware that you "bind" to an app, essentially providing it with an environment variable containing credentials (e.g. the location and username to use for the service).

The spring-cloud-cloudfoundry-commons module configures the Reactor-based Cloud Foundry Java client, v 3.0, and can be used standalone.

The spring-cloud-cloudfoundry-web project provides basic support for some enhanced features of webapps in Cloud Foundry: binding automatically to single-sign-on services and optionally enabling sticky routing for discovery.

The spring-cloud-cloudfoundry-discovery project provides an implementation of Spring Cloud Commons DiscoveryClient so you can @EnableDiscoveryClient and provide your credentials as spring.cloud.cloudfoundry.discovery.[username,password] (also *.url if you are not connecting to Pivotal Web Services) and then you can use the DiscoveryClient directly or via a LoadBalancerClient.

Note
if you are looking for a way to bind to services then this is the wrong library. Check out the [Spring Cloud Connectors](https://github.com/spring-cloud/spring-cloud-connectors) instead.

Building

Basic Compile and Test

To build the source you will need to install JDK 1.8.

Spring Cloud uses Maven for most build-related activities, and you should be able to get off the ground quite quickly by cloning the project you are interested in and typing

$ ./mvnw install
Note
You can also install Maven (>=3.3.3) yourself and run the mvn command in place of ./mvnw in the examples below. If you do that you also might need to add -P spring if your local Maven settings do not contain repository declarations for spring pre-release artifacts.
Note
Be aware that you might need to increase the amount of memory available to Maven by setting a MAVEN_OPTS environment variable with a value like -Xmx512m -XX:MaxPermSize=128m. We try to cover this in the .mvn configuration, so if you find you have to do it to make a build succeed, please raise a ticket to get the settings added to source control.

The projects that require middleware (i.e. Redis) for testing generally require that a local instance of [Docker](https://www.docker.com/get-started) is installed and running.

Documentation

The spring-cloud-build module has a "docs" profile, and if you switch that on it will try to build asciidoc sources from src/main/asciidoc. As part of that process it will look for a README.adoc and process it by loading all the includes, but not parsing or rendering it, just copying it to ${main.basedir} (defaults to ${basedir}, i.e. the root of the project). If there are any changes in the README it will then show up after a Maven build as a modified file in the correct place. Just commit it and push the change.

Working with the code

If you don’t have an IDE preference we would recommend that you use Spring Tools Suite or Eclipse when working with the code. We use the m2eclipse eclipse plugin for maven support. Other IDEs and tools should also work without issue as long as they use Maven 3.3.3 or better.

Activate the Spring Maven profile

Spring Cloud projects require the 'spring' Maven profile to be activated to resolve the spring milestone and snapshot repositories. Use your preferred IDE to set this profile to be active, or you may experience build errors.

Importing into eclipse with m2eclipse

We recommend the m2eclipse eclipse plugin when working with eclipse. If you don’t already have m2eclipse installed it is available from the "eclipse marketplace".

Note
Older versions of m2e do not support Maven 3.3, so once the projects are imported into Eclipse you will also need to tell m2eclipse to use the right profile for the projects. If you see many different errors related to the POMs in the projects, check that you have an up to date installation. If you can’t upgrade m2e, add the "spring" profile to your settings.xml. Alternatively you can copy the repository settings from the "spring" profile of the parent pom into your settings.xml.

Importing into eclipse without m2eclipse

If you prefer not to use m2eclipse you can generate eclipse project metadata using the following command:

$ ./mvnw eclipse:eclipse

The generated eclipse projects can be imported by selecting import existing projects from the file menu.

Contributing

Spring Cloud is released under the non-restrictive Apache 2.0 license, and follows a very standard Github development process, using Github tracker for issues and merging pull requests into master. If you want to contribute even something trivial please do not hesitate, but follow the guidelines below.

Sign the Contributor License Agreement

Before we accept a non-trivial patch or pull request we will need you to sign the Contributor License Agreement. Signing the contributor’s agreement does not grant anyone commit rights to the main repository, but it does mean that we can accept your contributions, and you will get an author credit if we do. Active contributors might be asked to join the core team, and given the ability to merge pull requests.

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

Code Conventions and Housekeeping

None of these is essential for a pull request, but they will all help. They can also be added after the original pull request but before a merge.

  • Use the Spring Framework code format conventions. If you use Eclipse you can import formatter settings using the eclipse-code-formatter.xml file from the Spring Cloud Build project. If using IntelliJ, you can use the Eclipse Code Formatter Plugin to import the same file.

  • Make sure all new .java files to have a simple Javadoc class comment with at least an @author tag identifying you, and preferably at least a paragraph on what the class is for.

  • Add the ASF license header comment to all new .java files (copy from existing files in the project)

  • Add yourself as an @author to the .java files that you modify substantially (more than cosmetic changes).

  • Add some Javadocs and, if you change the namespace, some XSD doc elements.

  • A few unit tests would help a lot as well — someone has to do it.

  • If no-one else is using your branch, please rebase it against the current master (or other target branch in the main project).

  • When writing a commit message please follow these conventions, if you are fixing an existing issue please add Fixes gh-XXXX at the end of the commit message (where XXXX is the issue number).

Checkstyle

Spring Cloud Build comes with a set of checkstyle rules. You can find them in the spring-cloud-build-tools module. The most notable files under the module are:

spring-cloud-build-tools/
└── src
    ├── checkstyle
    │   └── checkstyle-suppressions.xml (3)
    └── main
        └── resources
            ├── checkstyle-header.txt (2)
            └── checkstyle.xml (1)
  1. Default Checkstyle rules

  2. File header setup

  3. Default suppression rules

Checkstyle configuration

Checkstyle rules are disabled by default. To add checkstyle to your project just define the following properties and plugins.

pom.xml
<properties>
<maven-checkstyle-plugin.failsOnError>true</maven-checkstyle-plugin.failsOnError> (1)
        <maven-checkstyle-plugin.failsOnViolation>true
        </maven-checkstyle-plugin.failsOnViolation> (2)
        <maven-checkstyle-plugin.includeTestSourceDirectory>true
        </maven-checkstyle-plugin.includeTestSourceDirectory> (3)
</properties>

<build>
        <plugins>
            <plugin> (4)
                <groupId>io.spring.javaformat</groupId>
                <artifactId>spring-javaformat-maven-plugin</artifactId>
            </plugin>
            <plugin> (5)
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
        </plugins>

    <reporting>
        <plugins>
            <plugin> (5)
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>
</build>
  1. Fails the build upon Checkstyle errors

  2. Fails the build upon Checkstyle violations

  3. Checkstyle analyzes also the test sources

  4. Add the Spring Java Format plugin that will reformat your code to pass most of the Checkstyle formatting rules

  5. Add checkstyle plugin to your build and reporting phases

If you need to suppress some rules (e.g. line length needs to be longer), then it’s enough for you to define a file under ${project.root}/src/checkstyle/checkstyle-suppressions.xml with your suppressions. Example:

projectRoot/src/checkstyle/checkstyle-suppresions.xml
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
		"-//Puppy Crawl//DTD Suppressions 1.1//EN"
		"https://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
	<suppress files=".*ConfigServerApplication\.java" checks="HideUtilityClassConstructor"/>
	<suppress files=".*ConfigClientWatch\.java" checks="LineLengthCheck"/>
</suppressions>

It’s advisable to copy the ${spring-cloud-build.rootFolder}/.editorconfig and ${spring-cloud-build.rootFolder}/.springformat to your project. That way, some default formatting rules will be applied. You can do so by running this script:

$ curl https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/.editorconfig -o .editorconfig
$ touch .springformat

IDE setup

Intellij IDEA

In order to setup Intellij you should import our coding conventions, inspection profiles and set up the checkstyle plugin. The following files can be found in the Spring Cloud Build project.

spring-cloud-build-tools/
└── src
    ├── checkstyle
    │   └── checkstyle-suppressions.xml (3)
    └── main
        └── resources
            ├── checkstyle-header.txt (2)
            ├── checkstyle.xml (1)
            └── intellij
                ├── Intellij_Project_Defaults.xml (4)
                └── Intellij_Spring_Boot_Java_Conventions.xml (5)
  1. Default Checkstyle rules

  2. File header setup

  3. Default suppression rules

  4. Project defaults for Intellij that apply most of Checkstyle rules

  5. Project style conventions for Intellij that apply most of Checkstyle rules

Code style
Figure 1. Code style

Go to FileSettingsEditorCode style. There click on the icon next to the Scheme section. There, click on the Import Scheme value and pick the Intellij IDEA code style XML option. Import the spring-cloud-build-tools/src/main/resources/intellij/Intellij_Spring_Boot_Java_Conventions.xml file.

Code style
Figure 2. Inspection profiles

Go to FileSettingsEditorInspections. There click on the icon next to the Profile section. There, click on the Import Profile and import the spring-cloud-build-tools/src/main/resources/intellij/Intellij_Project_Defaults.xml file.

Checkstyle

To have Intellij work with Checkstyle, you have to install the Checkstyle plugin. It’s advisable to also install the Assertions2Assertj to automatically convert the JUnit assertions

Checkstyle

Go to FileSettingsOther settingsCheckstyle. There click on the + icon in the Configuration file section. There, you’ll have to define where the checkstyle rules should be picked from. In the image above, we’ve picked the rules from the cloned Spring Cloud Build repository. However, you can point to the Spring Cloud Build’s GitHub repository (e.g. for the checkstyle.xml : https://raw.githubusercontent.com/spring-cloud/spring-cloud-build/master/spring-cloud-build-tools/src/main/resources/checkstyle.xml). We need to provide the following variables:

Important
Remember to set the Scan Scope to All sources since we apply checkstyle rules for production and test sources.

Duplicate Finder

Spring Cloud Build brings along the basepom:duplicate-finder-maven-plugin, that enables flagging duplicate and conflicting classes and resources on the java classpath.

Duplicate Finder configuration

Duplicate finder is enabled by default and will run in the verify phase of your Maven build, but it will only take effect in your project if you add the duplicate-finder-maven-plugin to the build section of the projecst’s pom.xml.

pom.xml
<build>
    <plugins>
        <plugin>
            <groupId>org.basepom.maven</groupId>
            <artifactId>duplicate-finder-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

For other properties, we have set defaults as listed in the plugin documentation.

You can easily override them but setting the value of the selected property prefixed with duplicate-finder-maven-plugin. For example, set duplicate-finder-maven-plugin.skip to true in order to skip duplicates check in your build.

If you need to add ignoredClassPatterns or ignoredResourcePatterns to your setup, make sure to add them in the plugin configuration section of your project:

<build>
    <plugins>
        <plugin>
            <groupId>org.basepom.maven</groupId>
            <artifactId>duplicate-finder-maven-plugin</artifactId>
            <configuration>
                <ignoredClassPatterns>
                    <ignoredClassPattern>org.joda.time.base.BaseDateTime</ignoredClassPattern>
                    <ignoredClassPattern>.*module-info</ignoredClassPattern>
                </ignoredClassPatterns>
                <ignoredResourcePatterns>
                    <ignoredResourcePattern>changelog.txt</ignoredResourcePattern>
                </ignoredResourcePatterns>
            </configuration>
        </plugin>
    </plugins>
</build>

spring-cloud-cloudfoundry's People

Contributors

ahmedmq avatar aleksimpson avatar chrismathews avatar jeanbza avatar joshlong avatar krujos avatar making avatar marcingrzejszczak avatar olgamaciaszek avatar ryanjbaxter avatar s-bortolussi avatar scottfrederick avatar spencergibb avatar spring-builds avatar spring-operator avatar tysewyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spring-cloud-cloudfoundry's Issues

No Support for Sentinels

When I deploy a Spring Application on CF. the java buildpack tries to reconfigure spring to work with its 'cloud' profile.

https://github.com/cloudfoundry/java-buildpack-auto-reconfiguration

As a result, the application picks up this configuration/profile.Due to this, the application fails when a Redis Multinode/HA instance is used.

I feel this is something to do with the way the HA/ Multinode Redis Service is deployed/ provided.

Our fix for the timebeing was to disable autoconfiguration through the manifest file.

JBP_CONFIG_SPRING_AUTO_RECONFIGURATION: '{enabled: false}'

Does Spring cloud not support Sentinels. Or is this due to some other issue?

Use plans to segregate broker apps by space

E.g. instead of all broker apps having the "free" plan (available to all) they could check if the plan name correlates with the space name and only allow binding (or instance creation).

support a Spring Cloud Commons `DiscoveryClient` implementation that talks to Cloud Foundry's API

This implementation would work like the Eureka, Consul, and Zookeeper implementations and would provide a common way to programmatically ask questions about services (other applications) in a CF space. So, for example, i could use the DC to ask for the (external, load-balanced gorouter ..) CF route for the service ID foo.

@Autowired 
void init (DiscoveryClient dc ){ 
      dc.getServiceInstances( "my-service").forEach ( 
              (ServiceInstance si)-> System.out.println( "found " + si )  );
}

Perhaps it could even give back all the instances that are running instead of just the external route if CF supported that. The benefits so far as I've thought about this are that code could use the DC ina consistent way for service discovery whether it's using Consul, Zookeeper, Eureka or CF. CF already maintains these mapping so - if you don't need the metadata or specific features of one of the other service registries, it might be very natural to just use the mappings that CF can provide.

I talked to the good Dr. Syer about this and he raises the good point that it's not easy to get the CF token for the CF API.

The other implementations also handle automatic service registration and de-registration, but obviously CF doesn't need that. this implies that you'd only ever get one ServiceInstance for each service ID in the simplest case

ConfigClient not working with CloudFoundry's Discovery Client when configPath is set

I have a configserver published on custom "/config" path.

Problem

  • With Eureka Discovery the ConfigClient connects succesfully to config server.
  • However, when using CloudFoundry Discovery the ConfigClient connects to the wrong URL (with no prefix)

As far as I understand

  • DiscoveryClientConfigServiceBootstrapConfiguration is getting the "configPath" from the ServiceInstance metadata.
  • When using Eureka, the EurekaClientConfigServerAutoConfiguration registers the "configPath" to the Service Registry into the metadata and the EurekaDiscoveryClient gets metadata from instance, so it works like a charm.
  • However, when using CloudFoundry Discovery, I didn't find the corresponding Post-Processor who should contribute to this metadata, so there is not "configPath" published to the metadata. Moreso, CloudFoundry's ServiceInstance interface apparently doesn't support access to the metadata got from the registry (class is ignoring metadata). And CloudFoundry's CloudEntity containing the instance data got from the Service Registry has "meta" but it isn't variable. It has an "env" properties but it's actually the cloud-foundry's environments variables.

Question
How can I workaround this?

Database connection timeouts not configured correctly

We are using Spring-Cloud connector with Spring-Boot on an application deployed to Pivotal Web Services. Spring-Cloud-Cloudfoundry configures us to talk to our cleardb database automatically.

We are also using the Hikari Connection pool.

We get frequent warnings in our log files from Hikari that our connections have timed out. This appears to be because our server is used infrequently, so clearDb closes our connections on their side, then the connection pool discovers this and a huge stack trace is logged.

I found other people having similar issues online. Although they may not be with Spring, or even PWS, I would suggest this indicates a general problem which could be solved more gracefully by having the connector provide more information, or at least reasonable defaults.

Here is how we are configuring our connection:

@Configuration
@Profile("mysql-cloud")
public class MysqlCloudConfiguration extends AbstractCloudConfig {

    @Bean
    public DataSource dataSource() {
        return connectionFactory().dataSource();
    }
}

I have tried to set our connection parameters directly, but they don't seem to take effect. I think that is a Spring-Boot issue.

Here are the connection parameters we end up using from Hikari. These are the defaults, and I think that the connector should be setting connectionTimeout and idleTimeout.

DEBUG com.zaxxer.hikari.HikariConfig - connectionInitSql............... 
DEBUG com.zaxxer.hikari.HikariConfig - connectionTestQuery............./* ping */ SELECT 1 
DEBUG com.zaxxer.hikari.HikariConfig - connectionTimeout...............30000 
DEBUG com.zaxxer.hikari.HikariConfig - dataSource...................... 
DEBUG com.zaxxer.hikari.HikariConfig - dataSourceClassName............. 
DEBUG com.zaxxer.hikari.HikariConfig - dataSourceJNDI.................. 
DEBUG com.zaxxer.hikari.HikariConfig - dataSourceProperties............{password=<masked>} 
DEBUG com.zaxxer.hikari.HikariConfig - driverClassName................. 
DEBUG com.zaxxer.hikari.HikariConfig - idleTimeout.....................600000 
DEBUG com.zaxxer.hikari.HikariConfig - initializationFailFast..........false 
DEBUG com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false 
DEBUG com.zaxxer.hikari.HikariConfig - jdbc4ConnectionTest.............false 
DEBUG com.zaxxer.hikari.HikariConfig - jdbcUrl.........................jdbc:mysql://us-cdbr-iron-east-01.cleardb.net:3306/<redacted>&reconnect=true 
DEBUG com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........0 
DEBUG com.zaxxer.hikari.HikariConfig - maxLifetime.....................1800000 
DEBUG com.zaxxer.hikari.HikariConfig - maximumPoolSize.................4 
DEBUG com.zaxxer.hikari.HikariConfig - metricsTrackerClassName.........com.zaxxer.hikari.metrics.CodaHaleMetricsTracker 
DEBUG com.zaxxer.hikari.HikariConfig - minimumIdle.....................4 

Here are some similar online issues:

http://support.run.pivotal.io/entries/24868832-Network-problems-with-MySQL
http://stackoverflow.com/questions/24046843/connection-closed-error-in-heroku-cleardb-addon
https://getsatisfaction.com/cleardb/topics/connection_error_mysql2_error_mysql_server_has_gone_away

Here is the exception we are getting:

Here is the exception:

20:52:30.178 01:52:29.980 [http-nio-61032-exec-6] WARN com.zaxxer.hikari.pool.HikariPool - Exception during keep alive check, that means the connection (com.mysql.jdbc.JDBC4Connection@62fc8df6) must be dead.

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 349,959 milliseconds ago. The last packet sent successfully to the server was 1 milliseconds ago.

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_31-]

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_31-]

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_31-]

at java.lang.reflect.Constructor.newInstance(Constructor.java:408) ~[na:1.8.0_31-]

at com.mysql.jdbc.Util.handleNewInstance(Util.java:377) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]

at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1036) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]

at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3427) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]

at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:3327) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]

at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3814) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]

at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2435) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]

at com.mysql.jdbc.ConnectionImpl.pingInternal(ConnectionImpl.java:3971) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]

at com.mysql.jdbc.ConnectionImpl.ping(ConnectionImpl.java:3951) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]

at com.mysql.jdbc.StatementImpl.doPingInstead(StatementImpl.java:1509) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]

at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1395) ~[mysql-connector-java-5.1.34.jar!/:5.1.34]

at com.zaxxer.hikari.pool.HikariPool.isConnectionAlive(HikariPool.java:460) [HikariCP-2.1.0.jar!/:na]

at com.zaxxer.hikari.pool.HikariPool.getConnection(HikariPool.java:175) [HikariCP-2.1.0.jar!/:na]

at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:111) [HikariCP-2.1.0.jar!/:na]

at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:139) [hibernate-core-4.3.7.Final.jar!/:4.3.7.Final]

at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:380) [hibernate-core-4.3.7.Final.jar!/:4.3.7.Final]

at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:228) [hibernate-core-4.3.7.Final.jar!/:4.3.7.Final]

at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.getConnection(LogicalConnectionImpl.java:171) [hibernate-core-4.3.7.Final.jar!/:4.3.7.Final]

at org.hibernate.internal.SessionImpl.connection(SessionImpl.java:450) [hibernate-core-4.3.7.Final.jar!/:4.3.7.Final]

at sun.reflect.GeneratedMethodAccessor120.invoke(Unknown Source) ~[na:na]

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_31-]

at java.lang.reflect.Method.invoke(Method.java:483) ~[na:1.8.0_31-]

at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:202) [spring-core-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:187) [spring-core-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.orm.jpa.vendor.HibernateJpaDialect$HibernateConnectionHandle.doGetConnection(HibernateJpaDialect.java:378) [spring-orm-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.orm.jpa.vendor.HibernateJpaDialect.beginTransaction(HibernateJpaDialect.java:146) [spring-orm-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:380) [spring-orm-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:373) [spring-tx-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:457) [spring-tx-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:276) [spring-tx-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) [spring-tx-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136) [spring-tx-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.1.4.RELEASE.jar!/:4.1.4.RELEASE]

Ancient Cloudfoundry Operations version

We intended to use Spring Cloud Cloudfoundry Discovery (which depends on Spring Cloud Cloudfoundry Commons) in our webflux-based project using Spring Boot 2.3.0.RELEASE and Spring Cloud Hoxton.SR5. Unfortunately, colleagues ran into issues and the only solution that worked for them was to update (explicitly override) the following dependencies:

   <dependency>
      <groupId>org.cloudfoundry</groupId>
      <artifactId>cloudfoundry-client-reactor</artifactId>
      <version>${cloudfoundry.operations.version}</version>
    </dependency>

    <dependency>
      <groupId>org.cloudfoundry</groupId>
      <artifactId>cloudfoundry-operations</artifactId>
      <version>${cloudfoundry.operations.version}</version>
    </dependency>

... where cloudfoundry.operations.version now points to 4.8.0.RELEASE.

I investigated a bit and saw that Spring Cloud Cloudfoundry Commons still uses 3.9.0.RELEASE of these dependencies and I was wondering why? Is there a chance this can be bumped to a more recent version? E.g. Spring Cloud Deployer Cloudfoundry already uses 4.1.x.
The version is defined in Spring Cloud Cloudfoundry's root pom.xml as:

<cf-java-client.version>3.9.0.RELEASE</cf-java-client.version>

For now, we have removed Spring Cloud Cloudfoundry Discovery altogether and just reference the dependencies given above directly.

Thanks!

Upgrade CF Java Client dependency

A user of this project has reported an issue against Cloud Foundry Java Client that may be related to the outdated version of the java client included here (3.9.0.RELEASE instead of either 3.25.0.RELEASE or 4.8.0.RELEASE).

We're planning to EOL the 3.x line of the java client around the end of October, in line with the end of updates for Boot 2.1. Hence upgrading to the 4.x line, or possibly even the 5.x line that will be released around the same time, would be a worthwhile effort.

(The only difference beween 4.x and 5.x should be the underlying version of various reactor components, most noteably reactor-netty, so no functionality would be missed by upgrading to 4.x now and 5.x once it has stabilised a little.)

Update mvnw to 3.5.2

distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.2/apache-maven-3.5.2-bin.zip

Hard coded port 80 on CloudFoundryServer class

Dear,

I do have some problems using this library on cloud foundry due to hard coded port 80 into CloudFoundryServer class of 'spring-cloud-cloudfoundry-discovery' module.

CloudFoundryServer constructor:

	super(cloudApplication.getUris().iterator().next(), 80);

My services on cloud foundry are all secured so I need that CloudFoundryServer to take a configurable port in my case should be 443.

Can be the port taken from ribbon configuration defined into 'application.yml':
myservice.ribbon.IsSecure=true
myservice.ribbon.SecurePort=443

Nicolae

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.