Skip to content

Commit fa6f226

Browse files
authored
Feature/sqs documentation (#665)
1 parent 84e4234 commit fa6f226

33 files changed

+623
-100
lines changed

docker-compose.yml

-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ services:
3838
elasticmq:
3939
image: softwaremill/elasticmq-native:latest
4040
ports:
41-
- '9325:9325'
4241
- '9324:9324'
4342

4443
redis:

docs/dynamo.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Therefore, the connector provides three generic methods __single__, __transforme
2323

2424
Add the following dependency to get started:
2525
```scala
26-
libraryDependencies += "io.monix" %% "monix-dynamodb" % "0.6.0-RC1"
26+
libraryDependencies += "io.monix" %% "monix-dynamodb" % "0.6.0"
2727
```
2828

2929
## Async Client

docs/elasticsearch.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ but also to _search_ or _upload_ in a reactive fashion with _Monix Reactive_.
1515
Add the following dependency:
1616

1717
```scala
18-
libraryDependencies += "io.monix" %% "monix-elasticsearch" % "0.6.0-RC1"
18+
libraryDependencies += "io.monix" %% "monix-elasticsearch" % "0.6.0"
1919
```
2020

2121
## Client

docs/gcs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ object will be returned to any _get request_, globally.
1414

1515
Add the following dependency to get started:
1616
```scala
17-
libraryDependencies += "io.monix" %% "monix-gcs" % "0.6.0-RC1"
17+
libraryDependencies += "io.monix" %% "monix-gcs" % "0.6.0"
1818
```
1919

2020
## Getting Started

docs/hdfs.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ and it is built on top of the the official _apache hadoop_ api.
1818
Add the following dependency to get started:
1919

2020
```scala
21-
libraryDependencies += "io.monix" %% "monix-hdfs" % "0.6.0-RC1"
21+
libraryDependencies += "io.monix" %% "monix-hdfs" % "0.6.0"
2222
```
2323

2424
By default the connector uses _Hadoop 3.1.1_. In case you need a different one you can replace it by excluding `org.apache.hadoop` from `monix-hdfs` and add the new one to your library dependencies.

docs/mongodb.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
---
2-
id: mongodb title: MongoDB
2+
id: mongodb
3+
title: MongoDB
34
---
45

56
## Introduction
@@ -23,7 +24,7 @@ but before we will see how configure and connect to the database server.
2324
Add the following dependency to get started:
2425

2526
```scala
26-
libraryDependencies += "io.monix" %% "monix-mongodb" % "0.6.0-RC1"
27+
libraryDependencies += "io.monix" %% "monix-mongodb" % "0.6.0"
2728
```
2829

2930
## Collection Reference
@@ -147,10 +148,11 @@ val employee1 = Employee("Employee1", 21, "Paris")
147148
val employee2 = Employee("Employee2", 29, "Amsterdam")
148149
val businessCol = CollectionDocumentRef(database = "myDb", collection = "business_collection")
149150
val employeesCol =
150-
CollectionCodecRef("myDb", "employees_collection", classOf[Employee], createCodecProvider[Employee]())
151-
val connection = MongoConnection.create2("mongodb://host:27017", (employeesCol, businessCol))
151+
CollectionCodecRef("myDb", "employees_collection", classOf[Employee], createCodecProvider[Employee]())
152152

153-
connection.use { case (employeesOperator, businessOperator) =>
153+
// calling `create2` because we want operate with two mongodb collections.
154+
MongoConnection.create2("mongodb://host:27017", (employeesCol, businessCol))
155+
.use { case (employeesOperator, businessOperator) =>
154156
for {
155157
//business logic here
156158
_ <- employeesOperator.single.insertMany(List(employee1, employee2)) >>
@@ -223,7 +225,7 @@ val connection = MongoConnection.create1("mongodb://host:27017", employeesCol).u
223225
databaseName <- collOperator.db.listDatabases
224226
collectionName <- collOperator.db.listCollections(databaseName)
225227
// calling `listCollections` without arguments, would only
226-
// return the collections names from the current list
228+
// return the collections names from the current database
227229
} yield collectionName
228230
collections.count
229231
}

docs/overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ title: Overview
1818
Find and fill your release [version](https://github.com/monix/monix-connect/releases)):
1919

2020
```scala
21-
libraryDependencies += "io.monix" %% "monix-connect" % "0.6.0-RC1"
21+
libraryDependencies += "io.monix" %% "monix-connect" % "0.6.0"
2222
```
2323

2424
⚠️ **Mind that the project isn't yet stable, so binary compatibility is not guaranteed.**

docs/parquet.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Therefore, the `monix-parquet` _connector_ basically exposes stream integrations
1515
Add the following dependency:
1616

1717
```scala
18-
libraryDependencies += "io.monix" %% "monix-parquet" % "0.6.0-RC1"
18+
libraryDependencies += "io.monix" %% "monix-parquet" % "0.6.0"
1919
```
2020

2121
## Getting started

docs/redis.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ a _non blocking_ Redis client.
1919
Add the following dependency:
2020

2121
```scala
22-
libraryDependencies += "io.monix" %% "monix-redis" % "0.6.0-RC1"
22+
libraryDependencies += "io.monix" %% "monix-redis" % "0.6.0"
2323
```
2424

2525
## Redis Connection
@@ -60,8 +60,8 @@ servers in the cluster.
6060
import monix.connect.redis.client.{RedisConnection, RedisUri}
6161

6262
val redisNode1 = RedisUri("my.redis.node.1", 7000)
63-
val redisNode2 = RedisUri("my.redis.node.1", 7001)
64-
val redisNode3 = RedisUri("my.redis.node.1", 7002)
63+
val redisNode2 = RedisUri("my.redis.node.2", 7001)
64+
val redisNode3 = RedisUri("my.redis.node.3", 7002)
6565

6666
val redisClusterConn: RedisConnection = RedisConnection.cluster(List(redisNode1, redisNode2, redisNode3))
6767
```
@@ -487,7 +487,7 @@ And then from the application side you would do:
487487
import monix.connect.redis.client
488488
import monix.connect.redis.client.{RedisConnection, RedisUri}
489489

490-
val redisUris: Seq[RedisUri] = (0 to 5).map(n => RedisUri(s"redis://localhost:${(700 + n)}"))
490+
val redisUris: Seq[RedisUri] = (0 to 5).map(n => RedisUri(s"redis://localhost:${(7000 + n)}"))
491491
val clusterConn = RedisConnection.cluster(redisUris)
492492
```
493493

docs/s3.md

+12-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This module exposes a wide range of methods for interacting with S3 _buckets_ an
1616
Add the following dependency in your _build.sbt_:
1717

1818
```scala
19-
libraryDependencies += "io.monix" %% "monix-s3" % "0.6.0-RC1"
19+
libraryDependencies += "io.monix" %% "monix-s3" % "0.6.0"
2020
```
2121

2222
## Async Client
@@ -73,8 +73,9 @@ This module exposes a wide range of methods for interacting with S3 _buckets_ an
7373
This config file should be placed in the `resources` folder, therefore it will be automatically picked up from the method call `S3.fromConfig`, which will return a `cats.effect.Resource[Task, S3]`.
7474
The [resource](https://typelevel.org/cats-effect/datatypes/resource.html) is responsible of the *creation* and *release* of the _S3 client_.
7575

76-
We recommend using it transparently in your application, meaning that your methods and classes will directly expect an instance of _S3_, which will be called from within the
77-
_usage_ of the _Resource_. See below code snippet to understand the concept:
76+
**Try to reuse** the created **S3** client as much as possible in your application multiple times in your application. Otherwise, creating it
77+
multiple times will waste precious resources... See below code snippet to understand the concept:
78+
7879

7980
```scala
8081
import monix.connect.s3.S3
@@ -96,9 +97,9 @@ _usage_ of the _Resource_. See below code snippet to understand the concept:
9697
}
9798
} yield download
9899
}
99-
100+
100101
// the connection gets created and released within the use method and the `S3`
101-
// instance is directly passed to our application for an easier interoperability
102+
// instance is directly passed and should be reused across our application
102103
val f = S3.fromConfig.use(s3 => runS3App(s3)).runToFuture
103104
```
104105

@@ -279,7 +280,6 @@ import monix.eval.Task
279280

280281
val bucket = "my-bucket"
281282
val key = "sample/download/path/file.txt"
282-
val content: Array[Byte] = "Dummy file content".getBytes()
283283
val s3: S3
284284

285285
val t: Task[Array[Byte]] = s3.download("my-bucket", key)
@@ -478,7 +478,9 @@ that's because it is a heavy image and sometimes it takes bit long to start or i
478478
Finally, now you can already create the connection to _AWS S3_, _notice_ that _minio_ does not support _Anonymous credentials_, instead you'll have to use the _Static Credentials Provider_ and specify the _key_ and _secret_ corresponding respectively to the
479479
defined environment variables `MINIO_ACCESS_KEY` and `MINIO_SECRET_KEY`.
480480

481-
Below snippet represents the settings that would be needed to locally connect to _minio_ using config file:
481+
Below snippet represents the settings that would be needed to locally connect to _minio_ using config file, which should be placed
482+
under your test resources folder `src/test/resources`.
483+
482484

483485
```hocon
484486
{
@@ -494,7 +496,7 @@ Below snippet represents the settings that would be needed to locally connect to
494496
}
495497
```
496498

497-
Alternatively you can create connection like:
499+
Alternatively you can statically create connection by parameters:
498500

499501
```scala
500502
import monix.connect.s3.S3
@@ -511,10 +513,10 @@ val s3SecretKey: String = "TESTSECRET" //equal to the `env var `MINIO_SECRET_KEY
511513
val basicAWSCredentials = AwsBasicCredentials.create(s3AccessKey, s3SecretKey)
512514
val staticCredentialsProvider = StaticCredentialsProvider.create(basicAWSCredentials)
513515

514-
val s3: S3 = S3.createUnsafe(basicAWSCredentials, Region.EU_WEST_1, Some(URI.create(minioEndPoint)))
516+
val s3Resource = S3.create(basicAWSCredentials, Region.EU_WEST_1, Some(URI.create(minioEndPoint)))
515517
```
516518

517519

518520
### JVM S3 Mock library
519521

520-
In case you prefer to _start_ and _stop_ the _S3_ service from from the code of same test and therefore not depending on _docker_ but just on a _JVM library dependency_, you can refer to [findify/s3Mock](https://github.com/findify/s3mock) to see more.
522+
In case you prefer to _start_ and _stop_ the _S3_ service from the code of same test and therefore not depending on _docker_ but just on a _JVM library dependency_, you can refer to [findify/s3Mock](https://github.com/findify/s3mock) to find out more.

0 commit comments

Comments
 (0)