Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/audit-stores/community/couchbase-audit-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Here's a comprehensive example showing the configuration:

```java
// Create a Couchbase Target System
CouchbaseTargetSystem couchbaseTargetSystem = new CouchbaseTargetSystem("couchbase", cluster, bucket);
CouchbaseTargetSystem couchbaseTargetSystem = new CouchbaseTargetSystem("couchbase", cluster, "bucketName");
// Audit store configuration (mandatory via constructor)
var auditStore = CouchbaseSyncAuditStore.from(couchbaseTargetSystem)
.withScopeName("custom-scope") // Optional configuration
Expand Down
8 changes: 6 additions & 2 deletions docs/audit-stores/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,17 @@ Register the audit store with the Flamingock builder:
// Generic example - audit store configuration
public class App {
public static void main(String[] args) {

// TargetSystem
var targetSystem = new MongoDBSyncTargetSystem("mongodb-ts", mongoClient, "dbName");

// Create your audit store connection
var auditStore = new MongoDBSyncAuditStore(mongoClient, mongoDatabase);
var auditStore = MongoDBSyncAuditStore.from(targetSystem);

// Register with Flamingock
Flamingock.builder()
.setAuditStore(auditStore) // Set the audit store
.addTargetSystems(myTargetSystem)
.addTargetSystems(targetSystem)
.build()
.run();
}
Expand Down
4 changes: 2 additions & 2 deletions docs/changes/apply-and-rollback-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ Your Change methods receive the dependencies they need as parameters - Flamingoc

```java
@Apply
public void configureBucket(S3Client s3Client, AdminClient adminClient, FeatureFlagService flags) {
public void apply(S3Client s3Client, AdminClient adminClient, FeatureFlagService flags) {

}

@Rollback
public void configureBucket(S3Client s3Client, AdminClient adminClient, FeatureFlagService flags) {
public void rollback(S3Client s3Client, AdminClient adminClient, FeatureFlagService flags) {

}
```
Expand Down
7 changes: 4 additions & 3 deletions docs/flamingock-library-config/context-and-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ Every target system provides two ways to add dependencies:

**Specific methods** - Each concrete implementation offers `.withXXX()` methods for common dependencies:
```java
var mongoTarget = new MongoDBSyncTargetSystem("user-db")
.withDatabase(database) // MongoDB-specific method
.withMongoClient(client); // MongoDB-specific method
var mongoTarget = new MongoDBSyncTargetSystem("user-db", mongoClient, databaseName)
.withReadConcern(ReadConcern.MAJORITY) // MongoDB specific method
.withReadPreference(ReadPreference.primary()) // MongoDB specific method
.withWriteConcern(WriteConcern.MAJORITY); // MongoDB specific method
```

**Generic methods** - All target systems (including NonTransactionalTargetSystem) support generic dependency injection:
Expand Down
2 changes: 0 additions & 2 deletions docs/flamingock-library-config/lock.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ The lock mechanism is **mandatory** and is stored in your configured audit store
| `lockQuitTryingAfterMillis` | `180000` (3 min) | How long to retry acquiring the lock if another instance holds it. |
| `lockTryFrequencyMillis` | `1000` (1 sec) | Interval between attempts while waiting for the lock. |
| `throwExceptionIfCannotObtainLock` | `true` | Whether Flamingock should fail if the lock can't be acquired. |
| `enableRefreshDaemon` | `true` | Whether to run a background thread that periodically extends the lock. |


## Why locking matters
Expand Down Expand Up @@ -59,7 +58,6 @@ Flamingock.builder()
.setLockQuitTryingAfterMillis(300000)
.setLockTryFrequencyMillis(2000)
.setThrowExceptionIfCannotObtainLock(true)
.setEnableRefreshDaemon(true)
...
```

Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ For our example:
- A Kafka cluster (`kafka`)

```java
var sql = new SqlTargetSystem("mysql-inventory").withDatasource(ds);
var sql = new SqlTargetSystem("mysql-inventory", mysqlDataSource);
var s3 = new NonTransactionalTargetSystem("aws-s3-id");
var kafka = new NonTransactionalTargetSystem("kafka-id");
```
Expand Down
12 changes: 6 additions & 6 deletions docs/target-systems/couchbase-target-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ implementation("com.couchbase.client:java-client:3.6.0")
Configure the target system:

```java
var couchbaseTarget = new CouchbaseTargetSystem("user-database-id", cluster, bucket);
var couchbaseTarget = new CouchbaseTargetSystem("user-database-id", cluster, "userBucket");
```

The constructor requires the target system name, Couchbase cluster, and bucket. Optional configurations can be added via `.withXXX()` methods.
The constructor requires the target system name, Couchbase cluster, and bucket name. Optional configurations can be added via `.withXXX()` methods.

:::info Register Target System
Once created, you need to register this target system with Flamingock. See [Registering target systems](introduction.md#registering-target-systems) for details.
Expand All @@ -63,7 +63,7 @@ These dependencies must be provided at target system creation time with **no glo
| Dependency | Constructor Parameter | Description |
|------------|----------------------|-------------|
| `Cluster` | `cluster` | Couchbase cluster connection - **required** for both target system configuration and change execution |
| `Bucket` | `bucket` | Target bucket instance - **required** for both target system configuration and change execution |
| `String` | `bucketName` | Target bucket name - **required** for both target system configuration and change execution |

## Dependencies available to Changes

Expand All @@ -79,7 +79,7 @@ Here's a comprehensive example showing the new architecture:

```java
// Target system configuration (mandatory via constructor)
var couchbaseTarget = new CouchbaseTargetSystem("user-database", productionCluster, userBucket)
var couchbaseTarget = new CouchbaseTargetSystem("user-database", productionCluster, "userBucket")
.addDependency(auditService); // Additional dependency for changes

// Global context with shared dependencies
Expand All @@ -92,11 +92,11 @@ Flamingock.builder()

**Target system configuration resolution:**
- **Cluster**: Must be provided via constructor (`productionCluster`)
- **Bucket**: Must be provided via constructor (`userBucket`)
- **Bucket name**: Must be provided via constructor (`"userBucket"`)

**Change dependency resolution for Changes in "user-database":**
- **Cluster**: From target system context (`productionCluster`)
- **Bucket**: From target system context (`userBucket`)
- **Bucket**: From target system context (derived from `productionCluster` + `"userBucket"`)
- **TransactionAttemptContext**: From target system context (created by Flamingock)
- **AuditService**: From target system additional dependencies
- **EmailService**: From global context (fallback)
Expand Down