diff --git a/Makefile b/Makefile
index 9bb9c26..def8f97 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,7 @@ test: ## run tests quickly with the default Python
 
 coverage: ## generates codecov report
 	coverage run --source rele runtests.py tests
+	coverage report -m
 
 release: clean install-deploy-requirements sdist ## package and upload a release
 	twine upload -u mercadonatech dist/*
diff --git a/docs/index.rst b/docs/index.rst
index 659092f..ccb45db 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -32,9 +32,11 @@ Quickstart
 __________
 
 .. toctree::
-   :maxdepth: 2
+    :maxdepth: 2
+
+    quickstart/rele_and_emulator
+    quickstart/filters
 
-   quickstart/rele_and_emulator
 
 Modules
 _______
diff --git a/docs/quickstart/filters.rst b/docs/quickstart/filters.rst
new file mode 100644
index 0000000..20340d8
--- /dev/null
+++ b/docs/quickstart/filters.rst
@@ -0,0 +1,55 @@
+Filters
+=======
+
+Filter can be used to execute a subscription with specific parameters.
+There's two types of filters, global or passing a filter_by parameter in the
+subscription.
+
+
+Filters by `filter_by` parameter
+________________________________
+
+This filter is a function that is supposed to return a boolean and this function
+is passed as parameter `filter_by` in the subscription.
+
+.. code:: python
+
+    def landscape_filter(kwargs):
+        return kwargs.get('type') == 'landscape'
+
+
+    # This subscription is going to be called if in the `kwargs`
+    # has a key type with value landscape
+
+    @sub(topic='photo-updated', filter_by=landscape_filter)
+    def sub_process_landscape_photos(data, **kwargs):
+        print(f'Received a photo of type {kwargs.get("type")}')
+
+
+
+Global Filter
+_____________
+
+This filter is specified in the settings with the key `FILTER_SUBS_BY`
+that has a function as value.
+In case a subscription has a filter already it's going to use it's own filter.
+
+.. code:: python
+
+    import os
+
+    def landscape_filter(kwargs):
+        return kwargs.get('type') == 'landscape'
+
+    settings = {
+        'APP_NAME': 'test-rele',
+        'GC_PROJECT_ID': os.environ.get('GC_PROJECT_ID')   ,
+        'GC_CREDENTIALS': os.environ.get('GC_CREDENTIALS'),
+        'SUB_PREFIX': 'rele',
+        'MIDDLEWARE': [],
+        'FILTER_SUBS_BY': landscape_filter,
+    }
+
+
+
+
diff --git a/rele/config.py b/rele/config.py
index 8bac174..01fc176 100644
--- a/rele/config.py
+++ b/rele/config.py
@@ -22,7 +22,9 @@ def setup(setting):
     return config
 
 
-def load_subscriptions_from_paths(sub_module_paths, sub_prefix=None):
+def load_subscriptions_from_paths(
+        sub_module_paths, sub_prefix=None, filter_by=None):
+
     subscriptions = []
     for sub_module_path in sub_module_paths:
         sub_module = importlib.import_module(sub_module_path)
@@ -31,5 +33,9 @@ def load_subscriptions_from_paths(sub_module_paths, sub_prefix=None):
             if isinstance(attribute, Subscription):
                 if sub_prefix and not attribute.prefix:
                     attribute.set_prefix(sub_prefix)
+
+                if filter_by and not attribute.filter_by:
+                    attribute.set_filter_by(filter_by)
+
                 subscriptions.append(attribute)
     return subscriptions
diff --git a/rele/management/commands/runrele.py b/rele/management/commands/runrele.py
index f7f19d0..19ced37 100644
--- a/rele/management/commands/runrele.py
+++ b/rele/management/commands/runrele.py
@@ -17,7 +17,7 @@ class Command(BaseCommand):
     help = 'Start subscriber threads to consume Relé topics.'
 
     def handle(self, *args, **options):
-        subs = self._autodiscover_subs(settings.RELE['SUB_PREFIX'])
+        subs = self._autodiscover_subs()
         self.stdout.write(f'Configuring worker with {len(subs)} '
                           f'subscription(s)...')
         for sub in subs:
@@ -45,9 +45,11 @@ class Command(BaseCommand):
                 self.stdout.write(" * Discovered subs module: %r" % module)
         return subs_modules
 
-    def _autodiscover_subs(self, sub_prefix):
+    def _autodiscover_subs(self):
         return rele.config.load_subscriptions_from_paths(
-            self._discover_subs_modules(), sub_prefix)
+            self._discover_subs_modules(),
+            settings.RELE['SUB_PREFIX'],
+            settings.RELE.get('FILTER_SUBS_BY'))
 
     def _wait_forever(self):
         self.stdout.write('Consuming subscriptions...')
diff --git a/rele/subscription.py b/rele/subscription.py
index 2eb5868..67666c1 100644
--- a/rele/subscription.py
+++ b/rele/subscription.py
@@ -16,7 +16,7 @@ class Subscription:
         self.topic = topic
         self._prefix = prefix
         self._suffix = suffix
-        self._filter_by = filter_by or (lambda **_: True)
+        self._filter_by = filter_by
 
     @property
     def name(self):
@@ -30,18 +30,28 @@ class Subscription:
     def set_prefix(self, prefix):
         self._prefix = prefix
 
+    @property
+    def filter_by(self):
+        return self._filter_by
+
+    def set_filter_by(self, filter_by):
+        self._filter_by = filter_by
+
     def __call__(self, data, **kwargs):
         if 'published_at' in kwargs:
             kwargs['published_at'] = float(kwargs['published_at'])
 
-        if self._filter_by(**kwargs):
-            return self._func(data, **kwargs)
+        if self._filter_returns_false(kwargs):
+            return
 
-        return None
+        return self._func(data, **kwargs)
 
     def __str__(self):
         return f'{self.name} - {self._func.__name__}'
 
+    def _filter_returns_false(self, kwargs):
+        return self._filter_by and not self._filter_by(kwargs)
+
 
 class Callback:
 

Filter by message attribute
We would like to have our subscribers filter messages from a particular topic based on message attribute(s). For instance, we have one publisher publishing to topic `foobar`. The message is published with either attribute `location='backyard'` or `location='frontyard'`. 

If we have two subscribers listening to the same topic, one should only act on `location='backyard'`. 

I don't want to publish to two separate topics as they are publishing the same data type, only the location attribute changes from message to message. 

Additionally, we would like to globally define the filter value in the app. If we have two workers running the same subscriber, one should be able to filter the messages only for `backyard` messages and the other for `frontyard`. 

This is a proposal implementation:

```
# Scenario A (Local usage)

# subs.py
@sub('update_location', filter_by={'location': 'backyard'})
def update_location_backyard():
    pass

@sub('update_location', filter_by={'location': 'frontyard'})
def update_location_frontyard():
    pass
```


```
# Scenario B (Global Setting)

# settings.py
RELE_FILTER_BY={
    'update_location': {
        'location': 'frontyard'
    }
}

# subs.py
@sub('update_location', filter_by=settings.RELE_FILTER_BY)
def update_location():
    pass
```
diff --git a/tests/test_config.py b/tests/test_config.py
new file mode 100644
index 0000000..f232058
--- /dev/null
+++ b/tests/test_config.py
@@ -0,0 +1,30 @@
+import pytest
+from rele.config import load_subscriptions_from_paths
+from rele import sub
+
+
+@sub(topic='test-topic', prefix='rele')
+def sub_stub(data, **_kwargs):
+    return data
+
+
+class TestLoadSubscriptions:
+    @pytest.fixture
+    def subscriptions(self):
+        return load_subscriptions_from_paths(
+            ['tests.test_config'],
+            sub_prefix='test',
+            filter_by=lambda attrs: attrs.get('lang') == 'en')
+
+    def test_load_subscriptions_in_a_module(self, subscriptions):
+        assert len(subscriptions) == 1
+
+    def test_filter_by_applied_to_subscription_returns_true(
+            self, subscriptions):
+
+        assert subscriptions[-1].filter_by({'lang': 'en'}) is True
+
+    def test_filter_by_applied_to_subscription_returns_false(
+            self, subscriptions):
+
+        assert subscriptions[0].filter_by({'lang': 'es'}) is False
diff --git a/tests/test_subscription.py b/tests/test_subscription.py
index c8ea9ea..6ea8077 100644
--- a/tests/test_subscription.py
+++ b/tests/test_subscription.py
@@ -30,7 +30,7 @@ def sub_published_time_type(data, **kwargs):
     logger.info(f'{type(kwargs["published_at"])}')
 
 
-def landscape_filter(**kwargs):
+def landscape_filter(kwargs):
     return kwargs.get('type') == 'landscape'
 
 

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc
3.7
requirements/base.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
asgiref==3.7.2
backports.zoneinfo==0.2.1
cachetools==5.5.2
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
Deprecated==1.2.18
Django==3.2.25
djangorestframework==3.15.1
exceptiongroup==1.2.2
google-api-core==2.24.2
google-auth==2.38.0
google-cloud-pubsub==2.29.0
googleapis-common-protos==1.69.2
grpc-google-iam-v1==0.14.2
grpcio==1.62.3
grpcio-status==1.62.3
idna==3.10
importlib-metadata==6.7.0
iniconfig==2.0.0
opentelemetry-api==1.22.0
opentelemetry-sdk==1.22.0
opentelemetry-semantic-conventions==0.43b0
packaging==24.0
pluggy==1.2.0
proto-plus==1.26.1
protobuf==4.24.4
pyasn1==0.5.1
pyasn1-modules==0.3.0
pytest==7.4.4
pytz==2025.2
-e git+https://github.com/mercadona/rele.git@7c040182ce1523b21549dcf2579ce95571432c37#egg=rele
requests==2.31.0
rsa==4.9
sqlparse==0.4.4
tomli==2.0.1
typing_extensions==4.7.1
urllib3==2.0.7
wrapt==1.16.0
zipp==3.15.0

name: rele
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - asgiref==3.7.2
      - backports-zoneinfo==0.2.1
      - cachetools==5.5.2
      - charset-normalizer==3.4.1
      - deprecated==1.2.18
      - django==3.2.25
      - djangorestframework==3.15.1
      - exceptiongroup==1.2.2
      - google-api-core==2.24.2
      - google-auth==2.38.0
      - google-cloud-pubsub==2.29.0
      - googleapis-common-protos==1.69.2
      - grpc-google-iam-v1==0.14.2
      - grpcio==1.62.3
      - grpcio-status==1.62.3
      - idna==3.10
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - opentelemetry-api==1.22.0
      - opentelemetry-sdk==1.22.0
      - opentelemetry-semantic-conventions==0.43b0
      - packaging==24.0
      - pluggy==1.2.0
      - proto-plus==1.26.1
      - protobuf==4.24.4
      - pyasn1==0.5.1
      - pyasn1-modules==0.3.0
      - pytest==7.4.4
      - pytz==2025.2
      - requests==2.31.0
      - rsa==4.9
      - sqlparse==0.4.4
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - wrapt==1.16.0
      - zipp==3.15.0
prefix: /opt/conda/envs/rele

tests/test_config.py::TestLoadSubscriptions::test_load_subscriptions_in_a_module tests/test_config.py::TestLoadSubscriptions::test_filter_by_applied_to_subscription_returns_true tests/test_config.py::TestLoadSubscriptions::test_filter_by_applied_to_subscription_returns_false tests/test_subscription.py::TestSubscription::test_sub_executes_when_message_attributes_match_criteria tests/test_subscription.py::TestSubscription::test_sub_does_not_execute_when_message_attributes_dont_match_criteria
tests/test_subscription.py::TestSubscription::test_executes_callback_when_called
tests/test_subscription.py::TestSubscription::test_subs_return_subscription_objects tests/test_subscription.py::TestSubscription::test_subs_without_prefix_return_subscription_objects
Makefile rele/config.py docs/quickstart/filters.rst rele/management/commands/runrele.py rele/subscription.py docs/index.rst
Makefile rele/config.py docs/quickstart/filters.rst rele/management/commands/runrele.py rele/subscription.py docs/index.rst