Release v1.53.0
🚀 Features
🔹 Amazon SQS PubSub Support
GoFr now supports Amazon SQS as a messaging backend, enabling seamless integration with AWS Simple Queue Service for building resilient, distributed microservices.
- Supports both Publishing and Subscribing to SQS standard queues
- Configurable Behavior:
- Support for custom message attributes
- Configurable visibility timeouts and wait times
- Support for standard queues
Usage Example
To use Amazon SQS, import the driver and add it to your application:
import (
"gofr.dev/pkg/gofr"
"gofr.dev/pkg/gofr/datasource/pubsub/sqs"
)
func main() {
app := gofr.New()
app.AddPubSub(sqs.New(&sqs.Config{
Region: "us-east-1",
AccessKeyID: "your-access-key-id", // optional if using IAM roles
SecretAccessKey: "your-secret-access-key", // optional if using IAM roles
// Endpoint: "http://localhost:4566", // optional: for LocalStack
}))
app.Subscribe("my-queue", func(ctx *gofr.Context) error {
// Process message
return nil
})
app.Run()
}🚀 Enhancements
🔹 Metrics for HTTP Service Resilience
Enhanced observability for inter-service communication by adding dedicated metrics for resilience patterns.
- New metric
app_http_retry_count: Tracks the total number of retries performed for each downstream service - New metric
app_http_circuit_breaker_state: A gauge tracking the current state (0 for Closed, 1 for Open) of the circuit breaker - Updated Grafana Dashboards: Included new panels to visualize retry events and circuit breaker transitions, providing immediate insights into service stability and failure patterns. You can refer : https://github.com/gofr-dev/gofr/tree/main/examples/http-server/docker/provisioning/dashboards/gofr-dashboard
🔹 Configurable Metrics Server
Added the ability to disable the internal metrics server by setting the METRICS_PORT environment variable to 0. This provides greater flexibility for users who prefer to handle metrics collection through external agents or in environments where a separate metrics port is not required.
🛠️ Fixes
🔹 Zip Slip Vulnerability Protection
Improved the security of the file/zip package by implementing protection against Zip Slip (path traversal) attacks.
- Automatically validates file paths during extraction to ensure they remain within the target directory
- Rejects zip entries containing absolute paths or parent directory traversal sequences (
..) - Ensures safe handling of compressed files from untrusted sources