# Getting platform parameters when its deprecated

**URL:** <https://community.cumulocity.com/t/getting-platform-parameters-when-its-deprecated/441>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [March 6, 2023, 4:58pm UTC](https://community.cumulocity.com/t/getting-platform-parameters-when-its-deprecated/441 "2023-03-06T16:58:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arsalan\_Mahmood\_Sidd](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/arsalan_mahmood_sidd/32/30487_2.png) [@Arsalan\_Mahmood\_Sidd](https://community.cumulocity.com/u/Arsalan_Mahmood_Sidd)\
**Post date:** [March 6, 2023, 4:58pm UTC](https://community.cumulocity.com/t/getting-platform-parameters-when-its-deprecated/441/1 "2023-03-06T16:58:30Z")

</div>

#### What product/components do you use and which version/fix level are you on?

Version of cumulocity 1015

#### Is your question related to the free trial, or to a production (customer) instance?

production

#### What are you trying to achieve? Please describe it in detail.

I want to subscribe to all operations within a microservice using the following code:

```auto
	Subscriber subscriber = SubscriberBuilder.<String, OperationRepresentation>anSubscriber()
						.withEndpoint("cep/realtime").withParameters( **parameters** )
						.withSubscriptionNameResolver(new Identity()).withDataType(OperationRepresentation.class)
						.build();
				Subscription<String> subscription = subscriber.subscribe("/operations/*",
						new OperationDispatcherSubscriptionListener());

```

#### Do you get any error messages? Please provide a **full error** message screenshot and log file.

The log says that platform params have now been depracated. How can i get these in order to substitute it in the variable. The parameters var is mandatory.

Description:

Field platform in com.c8y.ms.templates.realtime.controller.NotificationController required a bean of type ‘com.cumulocity.sdk.client.PlatformImpl’ that could not be found.

Action:

Bean of this type is no longer available.  
Instead inject platform APIs directly or inject com.cumulocity.sdk.client.Platform and get the same platform APIs instances with getters.  
Use relative URL’s starting with ‘/’ with RestConnector bean to have them resolved automatically against the host defined in PlatformParameters#getHost().

#### Have you installed all the latest fixes for the products and systems you are using?

---

<div class="post-metadata">

**Author:** ![Arsalan\_Mahmood\_Sidd](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/arsalan_mahmood_sidd/32/30487_2.png) [@Arsalan\_Mahmood\_Sidd](https://community.cumulocity.com/u/Arsalan_Mahmood_Sidd)\
**Post date:** [March 13, 2023, 8:47pm UTC](https://community.cumulocity.com/t/getting-platform-parameters-when-its-deprecated/441/2 "2023-03-13T20:47:13Z")

</div>

```auto
@Autowired
       private RestConnector restConnector;

InventoryRealtimeDeleteAwareNotificationsSubscriber subscriber = new InventoryRealtimeDeleteAwareNotificationsSubscriber(restConnector.getPlatformParameters());

subscriber.subscribe("*",
                           new SubscriptionListener<String, ManagedObjectDeleteAwareNotification>() {
                    @Override
                    public void onNotification(Subscription<String> arg0, ManagedObjectDeleteAwareNotification notification) {
[…]

```

---

<div class="post-metadata">

**Author:** ![Arsalan\_Mahmood\_Sidd](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/arsalan_mahmood_sidd/32/30487_2.png) [@Arsalan\_Mahmood\_Sidd](https://community.cumulocity.com/u/Arsalan_Mahmood_Sidd)\
**Post date:** [March 13, 2023, 8:47pm UTC](https://community.cumulocity.com/t/getting-platform-parameters-when-its-deprecated/441/3 "2023-03-13T20:47:38Z")

</div>

```auto

            PlatformParameters platform = new PlatformParameters(
                                                        http://cumulocity:8111, 
                                                        microserviceCredentials.toCumulocityCredentials(), 
                                                        new ClientConfiguration());

InventoryRealtimeDeleteAwareNotificationsSubscriber subscriber = new InventoryRealtimeDeleteAwareNotificationsSubscriber(platform);

```

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [September 9, 2023, 8:48pm UTC](https://community.cumulocity.com/t/getting-platform-parameters-when-its-deprecated/441/4 "2023-09-09T20:48:32Z")

</div>

Closed on September 9, 2023, 8:48pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
