问题标签 [spring-cloud-connectors]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
715 浏览

hikaricp - 使用 HikariCP 的属性配置 Spring Cloud Connectors 的 PoolConfig 和 ConnectionConfig

我正在尝试配置Spring Cloud 连接器 PoolConfigConnectionConfig使用HikariCP 的属性。

这是我的 Sring Cloud 连接器数据源配置:

这是 HikariCP 的报告:

可以注意到,HikariCP 没有考虑到maxPoolSize11指定的内容:Hikari 的遗体在:... 有人可以帮忙吗?PoolConfigmaximumPoolSize10

0 投票
3 回答
13710 浏览

spring - 尝试使用本地 spring 云连接器/local_configuration_connector 时未找到合适的云连接器

我正在尝试使用本地云弹簧连接器在本地环境中测试我的应用程序,然后才能将其部署到基于 CF 的云环境中。从春天链接

http://cloud.spring.io/spring-cloud-connectors/spring-cloud-connectors.html#_local_configuration_connector

我遵循该过程并在项目资源目录中创建了名为 spring-cloud-bootstrap.properties 的属性文件。它有以下内容

spring.cloud.properties 文件:C:\Users\IBM_ADMIN\git\ServiceXchange5\ServiceXchange\spring-cloud.properties

我在上面给出的路径中有文件 spring-cloud.properties。

从spring configuaration bean我有以下

现在这个 DataSource bean 被注入到其他各个地方。有了适当的属性文件,我希望将创建用于本地配置的云连接器 bean,并且我应该能够使用它来为 DataSource 添加更多配置以进行连接池。

但是,当我访问应用程序时,本地配置连接器本身似乎没有激活。

我不确定为什么本地云连接器未激活。根据链接,它应该在检测到属性文件后。

注意:我尝试将属性文件放在不同的位置,例如(直接在应用程序根目录下、web-inf/lib 中、资源中等)

这里有什么帮助吗?

0 投票
3 回答
2203 浏览

spring-boot - Cloud Foundry Bind services/cups datasource number of connections

I am using hikari with spring boot, local testing I can see 50 active connections. After I deployed to cloud foundry , I am only able to see 10 active connections.

spring.datasource.hikari.maximum-pool-size=50

Seems like cloud foundry bind service is trying to overwrite my application's configuration. How can configure this number in cloud foundry?

maybe someone get help from this link, it says if you are running serious application in production , you need to configure DataSourceConfiguration

http://cloud.spring.io/spring-cloud-connectors/spring-cloud-spring-service-connector.html#_relational_database_db2_mysql_oracle_postgresql_sql_server

https://spring.io/blog/2015/04/27/binding-to-data-services-with-spring-boot-in-cloud-foundry

0 投票
0 回答
340 浏览

spring - 尝试通过 PCF 使用云连接器连接到 DB2

我正在尝试通过 PCF 使用 Spring Cloud Connectors 连接到 DB2,但我的 DB2 是 2-way SSL。谁能告诉我如何使用 Spring Cloud Connectors 配置 SSL?

通常我在没有 Spring Cloud 连接器的情况下这样使用

0 投票
2 回答
2446 浏览

spring - Spring Boot Cloud Foundry 错误中没有唯一服务处理接口错误

我正在尝试按照本教程https://github.com/cf-platform-eng/spring-boot-cities/tree/master/cities-service在 Cloud Foundry 中运行我的 Spring Boot 应用程序。我有本地 bosh-lite 安装

我的 Spring Boot 应用程序连接到 postgresql 作为数据库。我正在尝试连接到在我的本地(主机)上运行的 Postgresql 实例

如果部署到本地 tomcat,我的应用程序在本地运行良好。但是,当我将应用程序部署到 bosh-lite 时,它​​会失败并出现以下错误“没有唯一的服务处理接口错误”。我的代码与教程中提到的完全一样,除了我使用 Maven 来构建我的代码。

我与 postgres 的连接工作正常。如果我不使用 spring cloud 连接器并从 application.properties 中正常读取值,则相同的应用程序可以正常工作。

我的 pom.xml`(具有 spring boot 云连接器和 postgrsql 驱动程序的依赖项)

`

[更新] 根据 Scott 在下面的回答,我查看了获取云连接器的 UPS 的要求。因为我的是用户提供的服务,所以我不能有标签和标签。但我添加了 jdbc url。现在我的应用程序因以下错误而失败

为此,我已"spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect" 在我的 application.properties 中进行了设置,但仍然无法正常工作

我还检查了我的数据库是否正在运行并且我的服务实例中的数据库设置是否正确。

下面是我的服务实例内容`

` 最好的问候,索拉夫

0 投票
1 回答
830 浏览

spring - CF Spring boot 应用程序无法开始接受连接

我开发了一个连接到本地运行的 Postgresql 实例的 Spring Boot 应用程序。

现在我将应用程序部署到 Cloud Foundry 本地 bosh lite 安装。我为 postgresql 创建了一个用户提供的服务并将其绑定到我的应用程序。

到目前为止,该应用程序运行良好。然后我想将此应用程序作为服务代理。所以我再次使用了 Spring Boot Cloud Foundry 服务代理。并实现了与示例 mongodb spring boot 服务代理相同的代码。 https://github.com/spring-cloud-samples/cloudfoundry-service-broker

但是现在当我尝试启动应用程序时。它因以下错误而失败。

我在网上搜索,似乎错误与端口有关,并且端口无法访问。 https://github.com/cloudfoundry/cf-release/issues/649

但我没有为我的应用程序定义任何端口,我希望 CF 自动为我的应用程序分配一个端口

最好的问候, 索拉夫

0 投票
2 回答
3978 浏览

spring - 在 Spring Boot Cloud Foundry 应用程序中启用日志

如何在我的应用程序中启用 Spring 框架日志。? 我在我的应用程序中使用了 logback.xml 并将根级别设置为调试。当我尝试在本地运行应用程序时,会打印日志,但是当我在 CF 中部署应用程序时不会发生同样的情况。应用程序本身由于其他原因而崩溃,但我希望应该发生一些初始的 Spring Boot 框架日志记录。

下面是我的 logback.xml 文件。我不确定那里提到的控制台附加程序是否也可以在 CF 系统中工作。`

此致,

索拉夫

0 投票
1 回答
1100 浏览

java - 无法在简单的 Java 程序中读取 Cloud Foundry env 变量(不使用 spring)

我有一个简单的 Java 应用程序(不是 Spring 应用程序),它想从 Cloud Foundry 环境变量 VCAP_SERVICES 中获取 amazon RDS 数据库参数。我正在使用以下代码,但无法访问任何数据库。

我正在尝试图书馆主页上提供的示例代码之一。

Cloud Foundry 应用日志:

Java 应用程序:

上面的代码不会打印任何内容。

Cloud Foundry 环境变量:

pom.xml:

0 投票
3 回答
622 浏览

spring-amqp - 带有 RabbitMQ 的 Spring Cloud Spring 服务连接器

我使用 Spring Cloud Spring 服务连接器连接 CloudFoundry 上的 Rabbitmq 服务。

但我需要声明一个 CachingConnectionFactory 并将其 PublisherConfirms 设置为 true。因为我们在向队列发送消息时需要使用 publisherConfirm 来检查 ack。我不知道如何注入从云弹簧服务连接器获得的 connectionFactory。或者我们如何处理这种情况。

0 投票
1 回答
924 浏览

cloud-foundry - 如何在 Cloud Foundry 上设置 Spring Boot RabbitMQ 心跳?

我有一个使用 Spring Boot (1.5.12) 和 spring-boot-starter-amqp 在 Cloud Foundry 上运行的应用程序

基于前面的 SO answer to set heartbeat property on rabbitmq autoconfig connectionfactory bean,我尝试按如下方式设置 heartbeat 属性。

但是,通过 Rabbit 管理控制台查看时,连接仍然显示心跳是默认的 60 秒。

我使用执行器端点进行了堆转储,并查看了connectionFactory似乎已由 spring-cloud-spring-service-connector 自动重新配置的。它似乎有默认的 60 秒,并忽略了请求的 30 秒。

是否应该使用另一个环境属性来配置心跳值?如果没有,我怀疑我们将CachingConnectionFactory在那里连接并修改它。