Skip to content

Commit 27be0b7

Browse files
authored
Remove deprecated Java-based event ruler (#12158)
1 parent c10bf82 commit 27be0b7

File tree

7 files changed

+4
-140
lines changed

7 files changed

+4
-140
lines changed

docs/development-environment-setup/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@ LocalStack runs its own [DNS server](https://docs.localstack.cloud/user-guide/to
8585

8686
* macOS users need to configure `LAMBDA_DEV_PORT_EXPOSE=1` such that the host can reach Lambda containers via IPv4 in bridge mode (see [#7367](https://github.com/localstack/localstack/pull/7367)).
8787

88-
#### EVENT_RULE_ENGINE=java
89-
90-
* Requires Java to execute to invoke the AWS [event-ruler](https://github.com/aws/event-ruler) using [JPype](https://github.com/jpype-project/jpype), a Python to Java bridge.
91-
* Set `JAVA_HOME` to a JDK installation. For example: `JAVA_HOME=/opt/homebrew/Cellar/openjdk/21.0.2`
92-
9388
### Changing our fork of moto
9489

9590
1. Fork our moto repository on GitHub [https://github.com/localstack/moto](https://github.com/localstack/moto)

localstack-core/localstack/deprecations.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,8 @@ def is_affected(self) -> bool:
306306
EnvVarDeprecation(
307307
"EVENT_RULE_ENGINE",
308308
"4.0.3",
309-
"The Java-based event ruler is deprecated because our latest Python-native implementation introduced in 4.0.3"
309+
"This option is ignored because the Java-based event ruler has been removed since 4.1.0."
310+
" Our latest Python-native implementation introduced in 4.0.3"
310311
" is faster, achieves great AWS parity, and fixes compatibility issues with the StepFunctions JSONata feature."
311312
" Please remove EVENT_RULE_ENGINE.",
312313
),

localstack-core/localstack/services/events/event_ruler.py

Lines changed: 0 additions & 71 deletions
This file was deleted.

localstack-core/localstack/services/events/packages.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

localstack-core/localstack/services/events/plugins.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

localstack-core/localstack/utils/event_matcher.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
import json
21
from typing import Any
32

4-
from localstack import config
53
from localstack.services.events.event_rule_engine import (
64
EventPatternCompiler,
75
EventRuleEngine,
86
InvalidEventPatternException,
97
)
10-
from localstack.services.events.event_ruler import matches_rule
118

129
_event_pattern_compiler = EventPatternCompiler()
1310
_event_rule_engine = EventRuleEngine()
@@ -45,15 +42,6 @@ def matches_event(event_pattern: dict[str, Any] | str | None, event: dict[str, A
4542
if not event_pattern:
4643
return True
4744

48-
if config.EVENT_RULE_ENGINE == "java":
49-
# If inputs are already strings (EventBridge), use directly
50-
if isinstance(event, str) and isinstance(event_pattern, str):
51-
return matches_rule(event, event_pattern)
52-
# Convert dicts (ESM/Pipes) to strings for Java engine
53-
event_str = event if isinstance(event, str) else json.dumps(event)
54-
pattern_str = event_pattern if isinstance(event_pattern, str) else json.dumps(event_pattern)
55-
return matches_rule(event_str, pattern_str)
56-
5745
# Python implementation (default)
5846
compiled_event_pattern = _event_pattern_compiler.compile_event_pattern(
5947
event_pattern=event_pattern

tests/aws/services/events/test_archive_and_replay.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
import pytest
55

6-
from localstack import config
76
from localstack.testing.pytest import markers
87
from localstack.utils.strings import short_uid
98
from localstack.utils.sync import retry
@@ -363,10 +362,8 @@ def test_delete_archive_error_unknown_archive(self, aws_client, snapshot):
363362
class TestReplay:
364363
@markers.aws.validated
365364
@pytest.mark.skipif(is_old_provider(), reason="not supported by the old provider")
366-
@pytest.mark.skipif(
367-
condition=config.EVENT_RULE_ENGINE == "python",
368-
reason="Not supported with Python-based rule engine",
369-
)
365+
# TODO: Investigate and fix type error
366+
@pytest.mark.skip(reason="Fails with `TypeError: str.replace() takes no keyword arguments`")
370367
@pytest.mark.parametrize("event_bus_type", ["default", "custom"])
371368
@pytest.mark.skip_snapshot_verify(paths=["$..State"])
372369
def test_start_list_describe_canceled_replay(

0 commit comments

Comments
 (0)