Skip to content

Commit 51df224

Browse files
authored
Merge pull request #39 from linny0608/updateReadmeAndVersion
Update readme and version
2 parents 337a351 + ac19698 commit 51df224

File tree

8 files changed

+253
-22
lines changed

8 files changed

+253
-22
lines changed

connectors/README.md

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ exec sys.dbms_aqadm.start_queue('TxEventQ');
5656
exec sys.dbms_aqadm.add_subscriber('TxEventQ', SYS.AQ$_AGENT('SUB1', NULL, 0));
5757
```
5858

59-
If using the Source Connector and ordering of the events are important then the Transactional Event Queue that the Kakfa Source connector will be pulling from should have
60-
the `STICKY_DEQUEUE` parameter set. The `tasks.max` property should also correspond to the number of `SHARD_NUM` assigned to the queue.
59+
**If using the Source Connector and ordering of the events are important then the Transactional Event Queue that the Kakfa Source connector will be pulling from should have the `STICKY_DEQUEUE` parameter set. The `SHARD_NUM` assigned to the queue should be less than or equal to the number of Kafka partitions assigned to the Kafka topic.**
60+
61+
**Note: If running on a database version less than 23.4 with `STICKY_DEQUEUE` the `tasks.max` value must be equal to the `SHARD_NUM` specified. If the `tasks.max` is not equal to the `SHARD_NUM` dequeue from all event streams will not be performed.**
6162

6263
```roomsql
6364
exec sys.dbms_aqadm.create_sharded_queue(queue_name=>"TxEventQ", multiple_consumers => TRUE);
@@ -180,9 +181,10 @@ Here is the full `connect-txeventq-source.properties` file below.
180181
name=TxEventQ-source
181182
connector.class=oracle.jdbc.txeventq.kafka.connect.source.TxEventQSourceConnector
182183
183-
# If using event streams and ordering of the events is important the number of tasks
184-
# set for this property should be same number of event streams used for the transactional
185-
# event queue.
184+
# If the transactional event queue has STICKY_DEQUEUE set and running on a database version less than 23.4
185+
# the tasks.max number specified must be equal to the number of event streams (SHARD_NUM) for the queue.
186+
# If the `tasks.max` is not equal to the event streams (SHARD_NUM) dequeue from all event streams will not be performed when
187+
# using a database with a version less than 23.4.
186188
tasks.max=1
187189
188190
# The maximum number of messages in a batch. The default batch size is 1024.
@@ -259,13 +261,18 @@ In another command prompt start the Kafka server by running the following comman
259261
```
260262

261263
In the third command prompt start the connector in either standalone (connect-standalone.bat) or distributed (connect-distributed.bat) mode by running the following command.
262-
The command below is connecting in standalone mode. If connecting is distributed mode replace the bat file with the connect-distributed.bat file. If you want to run the source
263-
connector replace the properties file below with the properties file for the source connector.
264+
The command below is connecting in standalone mode. If you want to run the source connector replace the properties file below with the properties file for the source connector.
264265

265266
```bash
266267
.\bin\windows\connect-standalone.bat .\config\connect-standalone.properties .\config\connect-txeventq-sink.properties
267268
```
268269

270+
If connecting in distributed mode on a Windows environment enter the following command in a command prompt.
271+
272+
```bash
273+
.\bin\windows\connect-distributed.bat .\config\connect-distributed.properties
274+
```
275+
269276
If running Kafka in a Linux environment open 3 different terminals and change to the directory where Kafka has been installed.
270277

271278
Run the following command in one of the terminals to start zookeeper:
@@ -281,9 +288,31 @@ bin/kafka-server-start.sh config/server.properties
281288
```
282289

283290
In the third terminal start the connector in either standalone (connect-standalone.sh) or distributed (connect-distributed.sh) mode by running the following command.
284-
The command below is connecting in standalone mode. If connecting is distributed mode replace the bat file with the connect-distributed.sh file. If you want to run the source
285-
connector replace the properties file below with the properties file for the source connector.
291+
The command below is connecting in standalone mode. If you want to run the source connector replace the properties file below with the properties file for the source connector.
286292

287293
```bash
288294
bin/connect-standalone.sh config/connect-standalone.properties config/connect-TxEventQ-sink.properties
289295
```
296+
297+
If connecting in distributed mode on a Linux environment enter the following command in a command prompt.
298+
299+
```bash
300+
bin/connect-distributed.sh config/connect-distributed.properties
301+
```
302+
303+
Use REST calls to post configuration properties when running in distributed mode. An example of a JSON configuration is shown below.
304+
305+
```bash
306+
{
307+
"connector.class": "oracle.jdbc.txeventq.kafka.connect.source.TxEventQSourceConnector",
308+
"tasks.max": "5",
309+
"kafka.topic": <Kafka topic>,
310+
"value.converter": "org.apache.kafka.connect.converters.ByteArrayConverter",
311+
"db_tns_alias": <tns alias>,
312+
"wallet.path": <specify wallet path>,
313+
"tnsnames.path": <specify tnsnames path>,
314+
"txeventq.queue.name": <txEventQ queue name>,
315+
"txeventq.subscriber": <txEventQ subscriber>,
316+
"bootstrap.servers": <broker i.e localhost:9092>
317+
}
318+
```

connectors/THIRD_PARTY_LICENSE.txt

Lines changed: 135 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,17 @@ org.apache.kafka >> connect-json
2323
* See the License for the specific language governing permissions and
2424
* limitations under the License.
2525
*******************************************************************************/
26-
26+
27+
Oracle Free Distribution, Hosting, and Use Terms and Conditions (FDHUT)
28+
com.oracle.database.security >> oraclepki
29+
com.oracle.database.security >> osdt_core
30+
com.oracle.database.security >> osdt_cert
31+
com.oracle.database.jdbc >> ojdbc11
32+
com.oracle.database.messaging >> aqapi
33+
34+
CDDL
35+
javax.transaction >> jta
36+
2737
CDDL + GPL2
2838
javax.jms >> javax.jms-api
2939

@@ -32,6 +42,10 @@ org.slf4j >> slf4j-api
3242
Copyright (c) 2004-2022 QOS.ch Sarl (Switzerland)
3343
All rights reserved.
3444

45+
===============================================================================
46+
47+
## Licenses
48+
3549
##############################################################################
3650

3751
Apache License
@@ -1011,3 +1025,123 @@ based on this library. If you modify this library, you may extend this
10111025
exception to your version of the library, but you are not obligated to
10121026
do so. If you do not wish to do so, delete this exception statement
10131027
from your version.
1028+
1029+
######################################################################################
1030+
1031+
### FDHUT
1032+
1033+
1034+
Your use of this Program is governed by the Oracle Free Distribution, Hosting,
1035+
and Use Terms and Conditions set forth below, unless you have received this
1036+
Program (alone or as part of another Oracle product) under an Oracle license
1037+
agreement (including but not limited to the Oracle Master Agreement), in which
1038+
case your use of this Program is governed solely by such license agreement with
1039+
Oracle.
1040+
1041+
Oracle Free Distribution, Hosting, and Use Terms and Conditions
1042+
Definitions
1043+
"Oracle" refers to Oracle America, Inc. "You" and "Your" refers to (a) a
1044+
company or organization (each an "Entity") accessing the Programs, if use of
1045+
the Programs will be on behalf of such Entity; or (b) an individual accessing
1046+
the Programs, if use of the Programs will not be on behalf of an Entity.
1047+
"Program(s)" refers to Oracle software provided by Oracle pursuant to the
1048+
following terms and any updates, error corrections, and/or Program
1049+
Documentation provided by Oracle. "Program Documentation" refers to Program
1050+
user manuals and Program installation manuals, if any. If available, Program
1051+
Documentation may be delivered with the Programs and/or may be accessed from
1052+
www.oracle.com/documentation. "Separate Terms" refers to separate license terms
1053+
that are specified in the Program Documentation, readmes or notice files and
1054+
that apply to Separately Licensed Technology. "Separately Licensed Technology"
1055+
refers to Oracle or third party technology that is licensed under Separate
1056+
Terms and not under the terms of this license.
1057+
1058+
Separately Licensed Technology
1059+
Oracle may provide certain notices to You in Program Documentation, readmes or
1060+
notice files in connection with Oracle or third party technology provided as or
1061+
with the Programs. If specified in the Program Documentation, readmes or notice
1062+
files, such technology will be licensed to You under Separate Terms. Your
1063+
rights to use Separately Licensed Technology under Separate Terms are not
1064+
restricted in any way by the terms herein. For clarity, notwithstanding the
1065+
existence of a notice, third party technology that is not Separately Licensed
1066+
Technology shall be deemed part of the Programs licensed to You under the terms
1067+
of this license.
1068+
1069+
Source Code for Open Source Software
1070+
For software that You receive from Oracle in binary form that is licensed under
1071+
an open source license that gives You the right to receive the source code for
1072+
that binary, You can obtain a copy of the applicable source code from
1073+
https://oss.oracle.com/sources/ or http://www.oracle.com/goto/opensourcecode.
1074+
If the source code for such software was not provided to You with the binary,
1075+
You can also receive a copy of the source code on physical media by submitting
1076+
a written request pursuant to the instructions in the "Written Offer for Source
1077+
Code" section of the latter website.
1078+
1079+
-------------------------------------------------------------------------------
1080+
The following license terms apply to those Programs that are not provided to
1081+
You under Separate Terms.
1082+
License Rights and Restrictions
1083+
Oracle grants to You, as a recipient of this Program, a nonexclusive,
1084+
nontransferable, limited license to, subject to the conditions stated herein,
1085+
use the unmodified Programs, including, without limitation, for the purposes
1086+
of:
1087+
• developing, testing, prototyping and demonstrating applications;
1088+
• running the unmodified Programs for training, personal use, your
1089+
business operations, and the business operations of third parties;
1090+
• making the unmodified Programs available for use by third parties
1091+
in your hosted environment and in cloud services;
1092+
• redistributing unmodified Programs and Programs Documentation under
1093+
the terms of this License; and
1094+
• copying the unmodified Programs and Program Documentation to the extent
1095+
reasonably necessary to exercise the license rights granted herein and
1096+
for backup purposes.
1097+
For the purposes of this license, compiling, interpreting or configuring an
1098+
otherwise unmodified Program as necessary to run the Program shall not be
1099+
considered modification.
1100+
1101+
Your license is contingent on Your compliance with the following conditions:
1102+
- You include a copy of this license with any distribution by You of the
1103+
Programs;
1104+
- You do not charge your customers, end users, distributees or other third
1105+
parties any additional fees for the distribution or use of the Programs;
1106+
however, for clarity, if you comply with the foregoing condition,
1107+
distribution or use of the Program as part of your for-fee product or service
1108+
that adds substantial additional value is permitted;
1109+
- You do not remove markings or notices of either Oracle's or a licensor's
1110+
proprietary rights from the Programs or Program Documentation;
1111+
- You comply with all U.S. and applicable export control and economic sanctions
1112+
laws and regulations that govern Your use of the Programs (including
1113+
technical data); and
1114+
- You do not cause or permit reverse engineering, disassembly or decompilation
1115+
of the Programs (except as allowed by law) by You nor allow an associated
1116+
party to do so.
1117+
Any source code that may be included in the distribution with the Programs may
1118+
not be modified, unless such source code is under Separate Terms permitting
1119+
modification.
1120+
1121+
Ownership
1122+
Oracle or its licensors retain all ownership and intellectual property rights
1123+
to the Programs.
1124+
1125+
Information Collection
1126+
The Programs' installation and/or auto-update processes, if any, may transmit a
1127+
limited amount of data to Oracle or its service provider about those processes
1128+
to help Oracle understand and optimize them. Oracle does not associate the data
1129+
with personally identifiable information. Refer to Oracle's Privacy Policy at
1130+
www.oracle.com/privacy.
1131+
1132+
Disclaimer of Warranties; Limitation of Liability
1133+
THE PROGRAMS ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. ORACLE FURTHER
1134+
DISCLAIMS ALL WARRANTIES, EXPRESS AND IMPLIED, INCLUDING WITHOUT LIMITATION,
1135+
ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
1136+
NONINFRINGEMENT. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL ORACLE BE
1137+
LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
1138+
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM
1139+
(INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
1140+
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE
1141+
WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED
1142+
OF THE POSSIBILITY OF SUCH DAMAGES.
1143+
1144+
Version 1.0
1145+
Last updated: 28 June 2022
1146+
1147+
---

connectors/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66

77
<groupId>com.oracle.database.messaging</groupId>
88
<artifactId>txeventq-connector</artifactId>
9-
<version>1.1</version>
9+
<version>23.4.0.24.06</version>
1010

1111
<packaging>jar</packaging>
1212

1313
<!-- Start of fields requiring product specific values -->
1414
<name>TxEventQ-Connector</name>
1515
<description>Oracle's implementation of Kafka Sink and Source Connect for Oracle Transactional Event Queues.</description>
16-
<url>https://docs.oracle.com/en/database/oracle/oracle-database/21/okjdc/index.html</url>
16+
<url>https://docs.oracle.com/en/database/oracle/oracle-database/23/adque/Kafka_cient_interface_TEQ.html#GUID-C329D40D-21D6-454E-8B6A-49D96F0C8795</url>
1717
<!-- End of fields requiring product specific values -->
1818

1919
<licenses>

connectors/src/main/java/oracle/jdbc/txeventq/kafka/connect/source/task/TxEventQSourceTask.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ public class TxEventQSourceTask extends SourceTask {
5050

5151
private int batchSize;
5252

53+
private int tasksMax;
54+
5355
// Used to indicate when a batch has completed.
5456
private CountDownLatch batchCompleteIndicator = null;
5557

@@ -87,15 +89,18 @@ public void start(Map<String, String> properties) {
8789
this.connectorName = this.config.name();
8890

8991
this.batchSize = this.config.getInt(TxEventQConnectorConfig.TASK_BATCH_SIZE_CONFIG);
90-
9192
log.debug("The batch size is: {}", this.batchSize);
9293

94+
this.tasksMax = this.config.getInt(TxEventQConnectorConfig.TASK_MAX_CONFIG);
95+
log.debug("The tasks.max is: {}", this.tasksMax);
96+
9397
this.consumer.connect();
9498

9599
int kafkaPartitionNum = this.consumer.getKafkaTopicPartitionSize(
96100
this.config.getString(TxEventQConnectorConfig.KAFKA_TOPIC));
97101
int txEventQShardNum = this.consumer.getNumOfShardsForQueue(
98102
this.config.getString(TxEventQConnectorConfig.TXEVENTQ_QUEUE_NAME));
103+
99104
if (kafkaPartitionNum < txEventQShardNum) {
100105
throw new ConnectException("The number of Kafka partitions " + kafkaPartitionNum
101106
+ " must be greater than or equal to " + txEventQShardNum);

connectors/src/main/java/oracle/jdbc/txeventq/kafka/connect/source/utils/TxEventQConnectorConfig.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ public class TxEventQConnectorConfig extends AbstractConfig {
7979
private static final String TASK_BATCH_SIZE_DOC = "The maximum number of records that a connector task may read from the Oracle TxEventQ broker before writing to Kafka. The task holds these records until they are acknowledged in Kafka, so this may affect memory usage.";
8080
public static final int TASK_BATCH_SIZE_DEFAULT = 1024;
8181

82+
public static final String TASK_MAX_CONFIG = "tasks.max";
83+
private static final String TASK_MAX_DISPLAY = "Tasks Max";
84+
private static final String TASK_MAX_DOC = "Maximum number of tasks to use for this connector.";
85+
public static final int TASK_MAX_DEFAULT = 1;
86+
8287
public final String topic;
8388

8489
public TxEventQConnectorConfig(Map<String, String> originals) {
@@ -153,6 +158,10 @@ public static ConfigDef getConfig() {
153158
ConfigDef.Importance.MEDIUM, TASK_BATCH_SIZE_DOC, groupName, ++orderInGroup,
154159
ConfigDef.Width.MEDIUM, TASK_BATCH_SIZE_DISPLAY);
155160

161+
configDef.define(TASK_MAX_CONFIG, ConfigDef.Type.INT, TASK_MAX_DEFAULT,
162+
ConfigDef.Importance.HIGH, TASK_MAX_DOC, groupName, ++orderInGroup,
163+
ConfigDef.Width.MEDIUM, TASK_MAX_DISPLAY);
164+
156165
return configDef;
157166
}
158167

0 commit comments

Comments
 (0)