How to set limit in consuming message from google Pub/Sub? - spring

I just want to consume 1000 messages per minute from google pub/sup in my spring boot application. Is there a way to set it like this in spring boot application? I searched many websites but didn't find anything helpful.

Related

Receive mulitcast on Spring Boot rest application

I have developed a REST application using Spring Boot. Now I want to receive a multicast of a REST request on this application and respond to this multicast. However I have no clue how to implement this using Spring Boot and REST. I have looked online a lot and can't seem to find the answer.

Need of listening incoming emails using spring boot

Looking for some ideas on how to retrieve incoming emails (Exchange Server) for processing, like retrieve some information and invoke a web service. The service should constantly listening for new emails. So far we are looking into this using Spring Boot, and Apache Camel or Sprint Integration. Cannot find a clear example on this.
Hope someone help on this.
Have a look at the this API -
https://www.independentsoft.de/jwebservices/tutorial/findmessages1.html
You can create Spring scheduler to poll the exchange server to get the messages arrived in given time interval.
See Spring Integration documentation about e-mail support: https://docs.spring.io/spring-integration/docs/current/reference/html/mail.html#mail.
The MailTests can serve as a good sample how to configure Spring Integration channel adapters for e-mail polling: https://github.com/spring-projects/spring-integration/blob/main/spring-integration-mail/src/test/java/org/springframework/integration/mail/dsl/MailTests.java.
The Spring Boot environment doesn't matter at this point: there is no any auto-configuration for mail polling, so everything should be transparent as long as as you use Spring Integration recommendations.
Unfortunately the official sample we have is still an XML, but should give you some ideas what and how should be configuration for IMAP or POP3: https://github.com/spring-projects/spring-integration-samples/tree/main/basic/mail

Rate limit API in spring boot

I am building an application based on spring boot. A requirement to protect the application is the API access rate limit.
I have read a lot of articles on this issue. However, it has not yet found a way to get started.
I have found bucket4j, redis, ratelimiter guava. Give me an opinion on the solution that you find it reasonable.
Thanks !

Spring queue web service for tasks that take about 1 minute

I need to create a queue system for a web service in Spring boot. The service needs to do something on the server which takes about 1 minute, then the server will respond with a json to the client.
What do I need to use in Spring in order to achieve this is a reliable way?
It would be a good start if you read the documentation about Spring Boot RESTfull API.
https://spring.io/guides/gs/rest-service/

Spring Boot Actutor web metrics - disable (or group) http_server_requests_seconds_sum

I have a service which handles quite a big amount of REST requests (arount 500k per hour). Most of these calls are GET request with diffrent URLs. To grab metrics from the service I'm using Spring Boot Actuator (services are writen with spring boot 2.0 ) with micrometer and prometheus. So on path: /actuator/prometheus I have all metrics for prometheus.
Now after around 10 min my services stop serving metric, and it could be because there are a lot of different URLs which cause a lot of http_server_requests_seconds_sum metrics.
I want to disable this metric, or maybe group it for all endpoints.
You could disable http metrics
management.metrics.enable.http=false
I found settings to disable this metric: auto-time-requests
But to make it work with reactive endpoint I need also to upgrade Spring Boot to 2.1.0.
There is side effect i don't know any information how many RQ handle my service.
Maybe now i change the question - is there any way to group this metric ?

Resources