diff --git a/capifcore/internal/eventservice/eventservice.go b/capifcore/internal/eventservice/eventservice.go
index a4fa079..0f7a8e8 100644
--- a/capifcore/internal/eventservice/eventservice.go
+++ b/capifcore/internal/eventservice/eventservice.go
@@ -33,6 +33,7 @@
 	"k8s.io/utils/strings/slices"
 	"oransc.org/nonrtric/capifcore/internal/common29122"
 	"oransc.org/nonrtric/capifcore/internal/eventsapi"
+	"oransc.org/nonrtric/capifcore/internal/publishserviceapi"
 	"oransc.org/nonrtric/capifcore/internal/restclient"
 )
 
@@ -132,10 +133,9 @@
 		subscription := es.subscriptions[subId]
 		if subscription.EventFilters == nil || event.EventDetail == nil {
 			matchingSubs = append(matchingSubs, subId)
-			break
-		}
-		if matchesFilters(*event.EventDetail.ApiIds, *subscription.EventFilters, getApiIdsFromFilter) &&
-			matchesFilters(*event.EventDetail.ApiInvokerIds, *subscription.EventFilters, getInvokerIdsFromFilter) {
+		} else if matchesFilters(event.EventDetail.ApiIds, *subscription.EventFilters, getApiIdsFromFilter) &&
+			matchesFilters(event.EventDetail.ApiInvokerIds, *subscription.EventFilters, getInvokerIdsFromFilter) &&
+			matchesFilters(getAefIdsFromEvent(event.EventDetail.ServiceAPIDescriptions), *subscription.EventFilters, getAefIdsFromFilter) {
 			matchingSubs = append(matchingSubs, subId)
 		}
 	}
@@ -153,13 +153,14 @@
 	return matchingSubs
 }
 
-func matchesFilters(eventIds []string, filters []eventsapi.CAPIFEventFilter, getIds func(eventsapi.CAPIFEventFilter) *[]string) bool {
-	if len(filters) == 0 {
+func matchesFilters(eventIds *[]string, filters []eventsapi.CAPIFEventFilter, getIds func(eventsapi.CAPIFEventFilter) *[]string) bool {
+	if len(filters) == 0 || eventIds == nil {
 		return true
 	}
-	for _, id := range eventIds {
+	for _, id := range *eventIds {
 		filter := filters[0]
-		if getIds(filter) == nil {
+		filterIds := getIds(filter)
+		if filterIds == nil || len(*filterIds) == 0 {
 			return matchesFilters(eventIds, filters[1:], getIds)
 		}
 		return slices.Contains(*getIds(filter), id) && matchesFilters(eventIds, filters[1:], getIds)
@@ -170,10 +171,31 @@
 func getApiIdsFromFilter(filter eventsapi.CAPIFEventFilter) *[]string {
 	return filter.ApiIds
 }
+
 func getInvokerIdsFromFilter(filter eventsapi.CAPIFEventFilter) *[]string {
 	return filter.ApiInvokerIds
 }
 
+func getAefIdsFromEvent(serviceAPIDescriptions *[]publishserviceapi.ServiceAPIDescription) *[]string {
+	aefIds := []string{}
+	if serviceAPIDescriptions == nil {
+		return &aefIds
+	}
+	for _, serviceDescription := range *serviceAPIDescriptions {
+		if serviceDescription.AefProfiles == nil {
+			return &aefIds
+		}
+		for _, profile := range *serviceDescription.AefProfiles {
+			aefIds = append(aefIds, profile.AefId)
+		}
+	}
+	return &aefIds
+}
+
+func getAefIdsFromFilter(filter eventsapi.CAPIFEventFilter) *[]string {
+	return filter.AefIds
+}
+
 func asStrings(events []eventsapi.CAPIFEvent) []string {
 	asStrings := make([]string, len(events))
 	for i, event := range events {
diff --git a/capifcore/internal/eventservice/eventservice_test.go b/capifcore/internal/eventservice/eventservice_test.go
index bcc8c95..a328e57 100644
--- a/capifcore/internal/eventservice/eventservice_test.go
+++ b/capifcore/internal/eventservice/eventservice_test.go
@@ -39,6 +39,7 @@
 	"github.com/stretchr/testify/assert"
 	"oransc.org/nonrtric/capifcore/internal/common29122"
 	"oransc.org/nonrtric/capifcore/internal/eventsapi"
+	"oransc.org/nonrtric/capifcore/internal/publishserviceapi"
 	"oransc.org/nonrtric/capifcore/internal/restclient"
 )
 
@@ -176,52 +177,95 @@
 }
 
 func TestMatchEventTypeAndFilters(t *testing.T) {
-	notificationUrl := "url"
 	subId := "sub1"
 	apiIds := []string{"apiId"}
 	invokerIds := []string{"invokerId"}
+	aefId := "aefId"
+	aefIds := []string{aefId}
 	serviceUnderTest := NewEventService(nil)
 	serviceUnderTest.addSubscription(subId, eventsapi.EventSubscription{
 		Events: []eventsapi.CAPIFEvent{
 			eventsapi.CAPIFEventSERVICEAPIAVAILABLE,
 		},
-		NotificationDestination: common29122.Uri(notificationUrl),
 		EventFilters: &[]eventsapi.CAPIFEventFilter{
 			{
 				ApiIds:        &apiIds,
 				ApiInvokerIds: &invokerIds,
+				AefIds:        &aefIds,
 			},
 		},
 	})
+	serviceUnderTest.addSubscription("otherSameType", eventsapi.EventSubscription{
+		Events: []eventsapi.CAPIFEvent{
+			eventsapi.CAPIFEventACCESSCONTROLPOLICYUNAVAILABLE,
+		},
+	})
 	serviceUnderTest.addSubscription("other", eventsapi.EventSubscription{
 		Events: []eventsapi.CAPIFEvent{
 			eventsapi.CAPIFEventACCESSCONTROLPOLICYUNAVAILABLE,
 		},
-		NotificationDestination: common29122.Uri(notificationUrl),
 	})
 
 	event := eventsapi.EventNotification{
-		Events: eventsapi.CAPIFEventSERVICEAPIAVAILABLE,
-		EventDetail: &eventsapi.CAPIFEventDetail{
-			ApiIds:        &apiIds,
-			ApiInvokerIds: &invokerIds,
-		},
+		Events: eventsapi.CAPIFEventACCESSCONTROLPOLICYUNAVAILABLE,
 	}
 
+	// Only match type
 	matchingSubs := serviceUnderTest.getMatchingSubs(event)
+	assert.Len(t, matchingSubs, 2)
+
+	// Match with all filter ids
+	aefProfiles := []publishserviceapi.AefProfile{
+		{
+			AefId: aefId,
+		},
+	}
+	serviceDescriptions := []publishserviceapi.ServiceAPIDescription{
+		{
+			AefProfiles: &aefProfiles,
+		},
+	}
+	event.Events = eventsapi.CAPIFEventSERVICEAPIAVAILABLE
+	event.EventDetail = &eventsapi.CAPIFEventDetail{
+		ApiIds:                 &apiIds,
+		ApiInvokerIds:          &invokerIds,
+		ServiceAPIDescriptions: &serviceDescriptions,
+	}
+	matchingSubs = serviceUnderTest.getMatchingSubs(event)
 	assert.Len(t, matchingSubs, 1)
 	assert.Equal(t, subId, matchingSubs[0])
 
+	// Un match apiId
 	otherApiIds := []string{"otherApiId"}
 	(*serviceUnderTest.subscriptions[subId].EventFilters)[0].ApiIds = &otherApiIds
 	matchingSubs = serviceUnderTest.getMatchingSubs(event)
 	assert.Len(t, matchingSubs, 0)
 
+	// Un match invokerId
 	otherInvokerIds := []string{"otherInvokerId"}
-	(*serviceUnderTest.subscriptions[subId].EventFilters)[0].ApiIds = &apiIds
+	(*serviceUnderTest.subscriptions[subId].EventFilters)[0].ApiIds = nil
 	(*serviceUnderTest.subscriptions[subId].EventFilters)[0].ApiInvokerIds = &otherInvokerIds
 	matchingSubs = serviceUnderTest.getMatchingSubs(event)
 	assert.Len(t, matchingSubs, 0)
+
+	// Un match aefId
+	otherAefIds := []string{"otherAefId"}
+	(*serviceUnderTest.subscriptions[subId].EventFilters)[0].ApiInvokerIds = nil
+	(*serviceUnderTest.subscriptions[subId].EventFilters)[0].AefIds = &otherAefIds
+	matchingSubs = serviceUnderTest.getMatchingSubs(event)
+	assert.Len(t, matchingSubs, 0)
+
+	// Match with empty subscription filter id list
+	(*serviceUnderTest.subscriptions[subId].EventFilters)[0].AefIds = &[]string{}
+	matchingSubs = serviceUnderTest.getMatchingSubs(event)
+	assert.Len(t, matchingSubs, 1)
+
+	// Match with empty event id list
+	event.EventDetail.ApiIds = nil
+	event.EventDetail.ApiInvokerIds = nil
+	event.EventDetail.ServiceAPIDescriptions = &[]publishserviceapi.ServiceAPIDescription{}
+	matchingSubs = serviceUnderTest.getMatchingSubs(event)
+	assert.Len(t, matchingSubs, 1)
 }
 
 func getEcho(client restclient.HTTPClient) (*EventService, *echo.Echo) {
