Support
Quality
Security
License
Reuse
kandi has reviewed SpringCloud and discovered the below as its top functions. This is intended to give you an instant insight into SpringCloud implemented functionality, and help decide if they suit your requirements.
基于SpringCloud2.1的微服务开发脚手架,整合了spring-security-oauth2、nacos、feign、sentinel、springcloud-gateway等。服务治理方面引入elasticsearch、skywalking、springboot-admin、zipkin等,让项目开发快速进入业务开发,而不需过多时间花费在架构搭建上。持续更新中
SpelParseException in Springcloud data flow
--url-expression='http://mydomain.fake:1234/myservice?myparams=myvalues'
--url-expression='http://mydomain.fake'+':1234/myservice?myparams=myvalues'
-----------------------
--url-expression='http://mydomain.fake:1234/myservice?myparams=myvalues'
--url-expression='http://mydomain.fake'+':1234/myservice?myparams=myvalues'
jhipster microservices client springcloud config with authorization header to jhipster registry
jhipster:
xxxxxxxxx
registry:
password: xxxxxxxxxxxxx
jhipster:
registry:
password: <correct_password>
██╗ ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗
██║ ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
██║ ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝
██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
:: JHipster 🤓 :: Running Spring Boot 2.5.4 ::
:: https://www.jhipster.tech ::
2021-11-08 11:36:28.507 INFO 3872 --- [ main] com.okta.developer.store.StoreApp : No active profile set, falling back to default profiles: dev,api-docs
2021-11-08 11:36:29.639 DEBUG 3872 --- [ main] i.g.r.utils.RxJava2OnClasspathCondition : RxJava2 related Aspect extensions are not activated, because RxJava2 is not on the classpath.
2021-11-08 11:36:29.641 DEBUG 3872 --- [ main] i.g.r.utils.ReactorOnClasspathCondition : Reactor related Aspect extensions are not activated because Resilience4j Reactor module is not on the classpath.
2021-11-08 11:36:29.656 DEBUG 3872 --- [ main] i.g.r.utils.RxJava2OnClasspathCondition : RxJava2 related Aspect extensions are not activated, because RxJava2 is not on the classpath.
-----------------------
jhipster:
xxxxxxxxx
registry:
password: xxxxxxxxxxxxx
jhipster:
registry:
password: <correct_password>
██╗ ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗
██║ ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
██║ ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝
██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
:: JHipster 🤓 :: Running Spring Boot 2.5.4 ::
:: https://www.jhipster.tech ::
2021-11-08 11:36:28.507 INFO 3872 --- [ main] com.okta.developer.store.StoreApp : No active profile set, falling back to default profiles: dev,api-docs
2021-11-08 11:36:29.639 DEBUG 3872 --- [ main] i.g.r.utils.RxJava2OnClasspathCondition : RxJava2 related Aspect extensions are not activated, because RxJava2 is not on the classpath.
2021-11-08 11:36:29.641 DEBUG 3872 --- [ main] i.g.r.utils.ReactorOnClasspathCondition : Reactor related Aspect extensions are not activated because Resilience4j Reactor module is not on the classpath.
2021-11-08 11:36:29.656 DEBUG 3872 --- [ main] i.g.r.utils.RxJava2OnClasspathCondition : RxJava2 related Aspect extensions are not activated, because RxJava2 is not on the classpath.
-----------------------
jhipster:
xxxxxxxxx
registry:
password: xxxxxxxxxxxxx
jhipster:
registry:
password: <correct_password>
██╗ ██╗ ██╗ ████████╗ ███████╗ ██████╗ ████████╗ ████████╗ ███████╗
██║ ██║ ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
██║ ████████║ ██║ ███████╔╝ ╚█████╗ ██║ ██████╗ ███████╔╝
██╗ ██║ ██╔═══██║ ██║ ██╔════╝ ╚═══██╗ ██║ ██╔═══╝ ██╔══██║
╚██████╔╝ ██║ ██║ ████████╗ ██║ ██████╔╝ ██║ ████████╗ ██║ ╚██╗
╚═════╝ ╚═╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══════╝ ╚═╝ ╚═╝
:: JHipster 🤓 :: Running Spring Boot 2.5.4 ::
:: https://www.jhipster.tech ::
2021-11-08 11:36:28.507 INFO 3872 --- [ main] com.okta.developer.store.StoreApp : No active profile set, falling back to default profiles: dev,api-docs
2021-11-08 11:36:29.639 DEBUG 3872 --- [ main] i.g.r.utils.RxJava2OnClasspathCondition : RxJava2 related Aspect extensions are not activated, because RxJava2 is not on the classpath.
2021-11-08 11:36:29.641 DEBUG 3872 --- [ main] i.g.r.utils.ReactorOnClasspathCondition : Reactor related Aspect extensions are not activated because Resilience4j Reactor module is not on the classpath.
2021-11-08 11:36:29.656 DEBUG 3872 --- [ main] i.g.r.utils.RxJava2OnClasspathCondition : RxJava2 related Aspect extensions are not activated, because RxJava2 is not on the classpath.
Spring Cloud Data Flow Passing Parameters to Data Flow Server
helm install my-release --set externalKafka.borkers=pkc...:9092 bitnami/spring-cloud-dataflow
stream deploy yourstream --properties "spring.cloud.dataflow.applicationProperties.stream.spring.cloud.stream.kafka.binder.configuration.ssl.endpoint.identification.algorithm=https..., spring.cloud.dataflow.applicationProperties.stream.spring.cloud.stream.kafka.binder.brokers=pkc...:9092"
-----------------------
helm install my-release --set externalKafka.borkers=pkc...:9092 bitnami/spring-cloud-dataflow
stream deploy yourstream --properties "spring.cloud.dataflow.applicationProperties.stream.spring.cloud.stream.kafka.binder.configuration.ssl.endpoint.identification.algorithm=https..., spring.cloud.dataflow.applicationProperties.stream.spring.cloud.stream.kafka.binder.brokers=pkc...:9092"
Spring Cloud Gateway Custom Gateway Filter Not Working
@SpringBootApplication
public class ApiGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(ApiGatewayApplication.class, args);
}
@Bean
public RouteLocator routeLocator(RouteLocatorBuilder rlb, AuthorizationHeaderFilter
authorizationHeaderFilter) {
return rlb
.routes()
.route(p -> p
.path("/users-ws/users/status")
.filters(f -> f.removeRequestHeader("Cookie")
.rewritePath("/users-ws/(?<segment>.*)", "/$\\{segment}")
.filter(authorizationHeaderFilter.apply(new
AuthorizationHeaderFilter.Config())))
.uri("lb://users-ws")
)
.build();
}
}
SpringCloud 2020.0.2 upgrade generates testing error
@SpringBootTest(
webEnvironment = RANDOM_PORT,
properties = {"spring.cloud.config.enabled=false"}
)
-----------------------
implementation 'org.springframework.cloud:spring-cloud-starter-config'
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
MockMvc receive 404 when prometheus endpoint is calling
@ExtendWith(SpringExtension.class)
@SpringBootTest(
webEnvironment = RANDOM_PORT,
properties = "management.metrics.export.prometheus.enabled")
@ActiveProfiles({"test"})
@AutoConfigureMockMvc
Disable Spring Cloud Kubernetes in local
spring.cloud.kubernetes.enabled=false
bootstrap.yml configuration not processed anymore with Spring Cloud 2020.0
spring:
cloud:
vault:
authentication: APPROLE
app-role:
role-id: ${role-id}
secret-id: ${secret-id}
role: pres-read
app-role-path: approle
uri: ${vault-server}
connection-timeout: 5000
read-timeout: 15000
config:
import: vault://secret/app/pres/
## Server Properties
server:
port: 8081
spring:
config:
import: vault://secret/app/pres/demo
activate:
on-profile: "demo"
datasource:
username: ${pres.db.username}
password: ${pres.db.password}
url: ${pres.db.url}
driver-class-name: com.mysql.cj.jdbc.Driver
-----------------------
spring:
cloud:
vault:
authentication: APPROLE
app-role:
role-id: ${role-id}
secret-id: ${secret-id}
role: pres-read
app-role-path: approle
uri: ${vault-server}
connection-timeout: 5000
read-timeout: 15000
config:
import: vault://secret/app/pres/
## Server Properties
server:
port: 8081
spring:
config:
import: vault://secret/app/pres/demo
activate:
on-profile: "demo"
datasource:
username: ${pres.db.username}
password: ${pres.db.password}
url: ${pres.db.url}
driver-class-name: com.mysql.cj.jdbc.Driver
-----------------------
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>
database issue during spring microservices
spring.datasource.username=root
spring.datasource.user=root
-----------------------
spring.datasource.username=root
spring.datasource.user=root
-----------------------
spring.datasource.username=root
Why does a web app container access mysql container within the same docker report a timeout error
jdbc:mysql://<HOST>:<PORT>/<DATABASE>
-----------------------
firewall-cmd --query-masquerade
firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --reload
echo 1 > /proc/sys/net/ipv4/ip_forward
sysctl -p
[admin@localhost ~]# ifconfig
br-4cf89773q8e0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255
inet6 fe80::42:77ff:fe34:3599 prefixlen 64 scopeid 0x20<link>
ether 02:42:77:34:35:99 txqueuelen 0 (Ethernet)
RX packets 26 bytes 1780 (1.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 46 bytes 4731 (4.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:36ff:fe73:a500 prefixlen 64 scopeid 0x20<link>
ether 02:42:36:73:a5:00 txqueuelen 0 (Ethernet)
RX packets 770 bytes 90572 (88.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 733 bytes 238016 (232.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
firewall-cmd --permanent --zone=trusted --change-interface=br-4cf89773q8e0
firewall-cmd --reload
-----------------------
firewall-cmd --query-masquerade
firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --reload
echo 1 > /proc/sys/net/ipv4/ip_forward
sysctl -p
[admin@localhost ~]# ifconfig
br-4cf89773q8e0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255
inet6 fe80::42:77ff:fe34:3599 prefixlen 64 scopeid 0x20<link>
ether 02:42:77:34:35:99 txqueuelen 0 (Ethernet)
RX packets 26 bytes 1780 (1.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 46 bytes 4731 (4.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:36ff:fe73:a500 prefixlen 64 scopeid 0x20<link>
ether 02:42:36:73:a5:00 txqueuelen 0 (Ethernet)
RX packets 770 bytes 90572 (88.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 733 bytes 238016 (232.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
firewall-cmd --permanent --zone=trusted --change-interface=br-4cf89773q8e0
firewall-cmd --reload
-----------------------
firewall-cmd --query-masquerade
firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --reload
echo 1 > /proc/sys/net/ipv4/ip_forward
sysctl -p
[admin@localhost ~]# ifconfig
br-4cf89773q8e0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255
inet6 fe80::42:77ff:fe34:3599 prefixlen 64 scopeid 0x20<link>
ether 02:42:77:34:35:99 txqueuelen 0 (Ethernet)
RX packets 26 bytes 1780 (1.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 46 bytes 4731 (4.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:36ff:fe73:a500 prefixlen 64 scopeid 0x20<link>
ether 02:42:36:73:a5:00 txqueuelen 0 (Ethernet)
RX packets 770 bytes 90572 (88.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 733 bytes 238016 (232.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
firewall-cmd --permanent --zone=trusted --change-interface=br-4cf89773q8e0
firewall-cmd --reload
-----------------------
firewall-cmd --query-masquerade
firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --reload
echo 1 > /proc/sys/net/ipv4/ip_forward
sysctl -p
[admin@localhost ~]# ifconfig
br-4cf89773q8e0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255
inet6 fe80::42:77ff:fe34:3599 prefixlen 64 scopeid 0x20<link>
ether 02:42:77:34:35:99 txqueuelen 0 (Ethernet)
RX packets 26 bytes 1780 (1.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 46 bytes 4731 (4.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:36ff:fe73:a500 prefixlen 64 scopeid 0x20<link>
ether 02:42:36:73:a5:00 txqueuelen 0 (Ethernet)
RX packets 770 bytes 90572 (88.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 733 bytes 238016 (232.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
firewall-cmd --permanent --zone=trusted --change-interface=br-4cf89773q8e0
firewall-cmd --reload
-----------------------
firewall-cmd --query-masquerade
firewall-cmd --zone=public --add-masquerade --permanent
firewall-cmd --reload
echo 1 > /proc/sys/net/ipv4/ip_forward
sysctl -p
[admin@localhost ~]# ifconfig
br-4cf89773q8e0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.19.0.1 netmask 255.255.0.0 broadcast 172.19.255.255
inet6 fe80::42:77ff:fe34:3599 prefixlen 64 scopeid 0x20<link>
ether 02:42:77:34:35:99 txqueuelen 0 (Ethernet)
RX packets 26 bytes 1780 (1.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 46 bytes 4731 (4.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255
inet6 fe80::42:36ff:fe73:a500 prefixlen 64 scopeid 0x20<link>
ether 02:42:36:73:a5:00 txqueuelen 0 (Ethernet)
RX packets 770 bytes 90572 (88.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 733 bytes 238016 (232.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
firewall-cmd --permanent --zone=trusted --change-interface=br-4cf89773q8e0
firewall-cmd --reload
QUESTION
Springcloud data flow stream with http-request post
Asked 2022-Mar-15 at 14:15I'm trying to deploy a springcloud data flow stream like this:
time | http-request --http-method-expression='POST' --url-expression='http://mydomain.fake/myservice?myparams=myvalues' | log
The stream deploy without errors, but when I check the http-request log I can see a exception. Obviously, the stream not works
Property or field 'POST' cannot be found on object of type 'org.springframework.messaging.support.GenericMessage'
I checked the HttpRequestFunctionProperties class from github, but I didn't get any clue about my fault.
Any help please?
Update 1:
I get it. It works with --http-method-expression=new String('POST')
BUT only when the stream is updated . I cant deploy the stream directly with this param ...
Thanks !!!
ANSWER
Answered 2022-Mar-15 at 14:15The error indicates that the SpEL parser is interpreting POST
as a field on the Message (the default evaluation context). The expression 'POST'
is not being parsed correctly as a literal string. This is most likely due to some escaping problem. Try what Gary suggests.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
No vulnerabilities reported
Save this library and start creating your kit
Explore Related Topics
Save this library and start creating your kit