diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroup.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroup.java
index f633b0e..eab9c12 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroup.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroup.java
@@ -56,22 +56,38 @@
     @Override
     public GroupValidationResult validate() {
         GroupValidationResult result = super.validate();
-        if (result.isValid() && (checkMissingMandatoryParams(topicSources)
-            || checkMissingMandatoryParams(topicSinks))) {
-            result.setResult(ValidationStatus.INVALID, "Mandatory parameters are missing. topic, servers "
-                + "and topicCommInfrastructure must be specified.");
+        if (result.isValid()) {
+            StringBuilder errorMsg = new StringBuilder();
+            StringBuilder missingSourceParams = checkMissingMandatoryParams(topicSources);
+            if (missingSourceParams.length() > 0) {
+                errorMsg.append(missingSourceParams.append("missing in topicSources. "));
+            }
+            StringBuilder missingSinkParams = checkMissingMandatoryParams(topicSinks);
+            if (missingSinkParams.length() > 0) {
+                errorMsg.append(missingSinkParams.append("missing in topicSinks."));
+            }
+
+            if (errorMsg.length() > 0) {
+                errorMsg.insert(0, "Mandatory parameters are missing. ");
+                result.setResult(ValidationStatus.INVALID, errorMsg.toString());
+            }
         }
         return result;
     }
 
-    private boolean checkMissingMandatoryParams(List<TopicParameters> topicParametersList) {
+    private StringBuilder checkMissingMandatoryParams(List<TopicParameters> topicParametersList) {
+        StringBuilder missingParams = new StringBuilder();
         for (TopicParameters topicParameters : topicParametersList) {
-            if (StringUtils.isBlank(topicParameters.getTopic())
-                || StringUtils.isBlank(topicParameters.getTopicCommInfrastructure())
-                || topicParameters.getServers().isEmpty()) {
-                return true;
+            if (StringUtils.isBlank(topicParameters.getTopic())) {
+                missingParams.append("topic, ");
+            }
+            if (StringUtils.isBlank(topicParameters.getTopicCommInfrastructure())) {
+                missingParams.append("topicCommInfrastructure, ");
+            }
+            if (null == topicParameters.getServers() || topicParameters.getServers().isEmpty()) {
+                missingParams.append("servers, ");
             }
         }
-        return false;
+        return missingParams;
     }
 }
diff --git a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/utils/ParameterUtils.java b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/utils/ParameterUtils.java
index cabfe58..5e93cfa 100644
--- a/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/utils/ParameterUtils.java
+++ b/policy-endpoints/src/main/java/org/onap/policy/common/endpoints/utils/ParameterUtils.java
@@ -21,12 +21,19 @@
 
 package org.onap.policy.common.endpoints.utils;
 
+import java.beans.IntrospectionException;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
 import java.util.List;
 import java.util.Properties;
-
+import org.apache.commons.lang3.StringUtils;
+import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
 import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
 import org.onap.policy.common.endpoints.parameters.TopicParameters;
 import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * This is common utility class with utility methods for parameters.
@@ -36,6 +43,11 @@
 public class ParameterUtils {
 
     /**
+     * Logger.
+     */
+    private static final Logger logger = LoggerFactory.getLogger(ParameterUtils.class);
+
+    /**
      * Private constructor used to prevent sub class instantiation.
      */
     private ParameterUtils() {
@@ -56,12 +68,10 @@
         // for each topicCommInfrastructure, there could be multiple topics (specified as comma separated string)
         // for each such topics, there could be multiple servers (specified as comma separated string)
         for (TopicParameters source : topicSources) {
-            updateTopicProperties(topicProperties, "source", source.getTopicCommInfrastructure(), source.getTopic(),
-                    source.getServers());
+            updateTopicProperties(topicProperties, "source", source);
         }
         for (TopicParameters sink : topicSinks) {
-            updateTopicProperties(topicProperties, "sink", sink.getTopicCommInfrastructure(), sink.getTopic(),
-                    sink.getServers());
+            updateTopicProperties(topicProperties, "sink", sink);
         }
 
         return topicProperties;
@@ -72,19 +82,45 @@
      *
      * @param topicProperties the topic properties object which is to be updated
      * @param keyName either it is source or sink
-     * @param topicCommInfra the infra such as  dmaap, ueb or noop
-     * @param topicName the topic
-     * @param servers the list of server names for the topic
+     * @param topicParameters the topic parameters object
      */
-    public static void updateTopicProperties(Properties topicProperties, String keyName, String topicCommInfra,
-            String topicName, List<String> servers) {
+    public static void updateTopicProperties(Properties topicProperties, String keyName,
+        TopicParameters topicParameters) {
+        String topicCommInfra = topicParameters.getTopicCommInfrastructure();
+        String topicName = topicParameters.getTopic();
+        List<String> servers = topicParameters.getServers();
+
         String propKey = topicCommInfra + "." + keyName + PolicyEndPointProperties.PROPERTY_TOPIC_TOPICS_SUFFIX;
         if (topicProperties.containsKey(propKey)) {
             topicProperties.setProperty(propKey, topicProperties.getProperty(propKey) + "," + topicName);
         } else {
             topicProperties.setProperty(propKey, topicName);
         }
-        topicProperties.setProperty(propKey + "." + topicName + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX,
+        String propWithTopicKey = propKey + "." + topicName;
+        topicProperties.setProperty(propWithTopicKey + PolicyEndPointProperties.PROPERTY_TOPIC_SERVERS_SUFFIX,
                 String.join(",", servers));
+
+        Field[] fields = BusTopicParams.class.getDeclaredFields();
+        for (Field field : fields) {
+            if (field.isSynthetic()) {
+                continue;
+            }
+            try {
+                Object parameter = new PropertyDescriptor(field.getName(), TopicParameters.class)
+                    .getReadMethod().invoke(topicParameters);
+                if ((parameter instanceof String && StringUtils.isNotBlank(parameter.toString()))
+                    || (parameter instanceof Number && ((Number) parameter).longValue() > 0)) {
+                    topicProperties.setProperty(propWithTopicKey + "." + field.getName(), parameter.toString());
+                }
+                if (parameter instanceof Boolean && (Boolean) parameter) {
+                    topicProperties.setProperty(propWithTopicKey + "." + field.getName(),
+                        Boolean.toString((Boolean) parameter));
+                }
+            } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException
+                | IntrospectionException e) {
+                logger.error("Error while creating Properties object from TopicParameters for {}", field.getName(), e);
+            }
+        }
+
     }
 }
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/CommonTestData.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/CommonTestData.java
index 346ac5d..e3f0878 100644
--- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/CommonTestData.java
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/CommonTestData.java
@@ -53,7 +53,7 @@
     public static final String TOPIC_INFRA = "dmaap";
     public static final String TOPIC_SERVER = "message-router";
 
-    protected static final List<TopicParameters> TOPIC_PARAMS =
+    public static final List<TopicParameters> TOPIC_PARAMS =
         Arrays.asList(getTopicParameters(TOPIC_NAME, TOPIC_INFRA, TOPIC_SERVER));
 
     protected static final Coder coder = new StandardCoder();
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroupTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroupTest.java
index e288009..f150736 100644
--- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroupTest.java
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/parameters/TopicParameterGroupTest.java
@@ -26,10 +26,12 @@
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import java.lang.reflect.Method;
+import java.beans.PropertyDescriptor;
+import java.lang.reflect.Field;
 import java.util.List;
 import org.apache.commons.lang3.StringUtils;
 import org.junit.Test;
+import org.onap.policy.common.endpoints.event.comm.bus.internal.BusTopicParams;
 import org.onap.policy.common.parameters.GroupValidationResult;
 import org.onap.policy.common.utils.coder.Coder;
 import org.onap.policy.common.utils.coder.CoderException;
@@ -123,12 +125,14 @@
      */
     private boolean checkIfAllParamsNotEmpty(List<TopicParameters> topicParametersList) throws Exception {
         for (TopicParameters topicParameters : topicParametersList) {
-            for (Method m : topicParameters.getClass().getMethods()) {
-                if (m.getName().startsWith("get") && m.getParameterTypes().length == 0) {
-                    final Object parameter = m.invoke(topicParameters);
+            Field[] fields = BusTopicParams.class.getDeclaredFields();
+            for (Field field : fields) {
+                if (!field.isSynthetic()) {
+                    Object parameter = new PropertyDescriptor(field.getName(), TopicParameters.class).getReadMethod()
+                        .invoke(topicParameters);
                     if ((parameter instanceof String && StringUtils.isBlank(parameter.toString()))
                         || (parameter instanceof Boolean && !(Boolean) parameter)
-                        || (parameter instanceof Number && ((Number)parameter).longValue() == 0)) {
+                        || (parameter instanceof Number && ((Number) parameter).longValue() == 0)) {
                         return false;
                     }
                 }
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java
index 06c16e9..54a1460 100644
--- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java
@@ -23,12 +23,16 @@
 package org.onap.policy.common.endpoints.utils;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
 
-import java.util.Arrays;
 import java.util.Properties;
 import org.junit.Test;
 import org.onap.policy.common.endpoints.parameters.CommonTestData;
 import org.onap.policy.common.endpoints.parameters.TopicParameterGroup;
+import org.onap.policy.common.parameters.GroupValidationResult;
+import org.onap.policy.common.utils.coder.Coder;
+import org.onap.policy.common.utils.coder.StandardCoder;
 
 /**
  * Class to perform unit test of {@link ParameterUtils}.
@@ -36,7 +40,11 @@
  * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
  */
 public class ParameterUtilsTest {
+    private static final String SOURCE_TOPICS_POLICY_PDP_PAP1 = ".source.topics.POLICY-PDP-PAP1.";
+    private static final String SINK_TOPICS_POLICY_PDP_PAP1 = ".sink.topics.POLICY-PDP-PAP1.";
     private static final String SERVERS = ".servers";
+    private static CommonTestData testData = new CommonTestData();
+    private static final Coder coder = new StandardCoder();
 
     /**
      * Test getTopicProperties from TopicParameterGroup.
@@ -60,17 +68,48 @@
     @Test
     public void testUpdateTopicProperties() {
         Properties topicProperties = new Properties();
-        ParameterUtils.updateTopicProperties(topicProperties, "source", CommonTestData.TOPIC_INFRA,
-            CommonTestData.TOPIC_NAME, Arrays.asList(CommonTestData.TOPIC_SERVER));
+        ParameterUtils.updateTopicProperties(topicProperties, "source", CommonTestData.TOPIC_PARAMS.get(0));
         assertEquals(CommonTestData.TOPIC_NAME,
             topicProperties.getProperty(CommonTestData.TOPIC_INFRA + ".source.topics"));
         assertEquals(CommonTestData.TOPIC_SERVER, topicProperties
             .getProperty(CommonTestData.TOPIC_INFRA + ".source.topics." + CommonTestData.TOPIC_NAME + SERVERS));
-        ParameterUtils.updateTopicProperties(topicProperties, "sink", CommonTestData.TOPIC_INFRA,
-            CommonTestData.TOPIC_NAME, Arrays.asList(CommonTestData.TOPIC_SERVER));
+        ParameterUtils.updateTopicProperties(topicProperties, "sink", CommonTestData.TOPIC_PARAMS.get(0));
         assertEquals(CommonTestData.TOPIC_NAME,
             topicProperties.getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics"));
         assertEquals(CommonTestData.TOPIC_SERVER, topicProperties
             .getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics." + CommonTestData.TOPIC_NAME + SERVERS));
     }
+
+    @Test
+    public void testGetTopicProperties_all_props() throws Exception {
+        String json = testData.getParameterGroupAsString(
+            "src/test/resources/org/onap/policy/common/endpoints/parameters/TopicParameters_all_params.json");
+        TopicParameterGroup topicParameterGroup = coder.decode(json, TopicParameterGroup.class);
+        final GroupValidationResult result = topicParameterGroup.validate();
+        assertNull(result.getResult());
+        assertTrue(result.isValid());
+        Properties topicProperties = ParameterUtils.getTopicProperties(topicParameterGroup);
+        assertEquals("true", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SOURCE_TOPICS_POLICY_PDP_PAP1 + "managed"));
+        assertEquals("true", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SINK_TOPICS_POLICY_PDP_PAP1 + "managed"));
+        assertEquals("123", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SOURCE_TOPICS_POLICY_PDP_PAP1 + "port"));
+        assertEquals("123", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SINK_TOPICS_POLICY_PDP_PAP1 + "port"));
+        assertEquals("my-api-key", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SOURCE_TOPICS_POLICY_PDP_PAP1 + "apiKey"));
+        assertEquals("my-api-key", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SINK_TOPICS_POLICY_PDP_PAP1 + "apiKey"));
+        assertEquals("my-effective-topic", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SOURCE_TOPICS_POLICY_PDP_PAP1 + "effectiveTopic"));
+        assertEquals("true", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SOURCE_TOPICS_POLICY_PDP_PAP1 + "useHttps"));
+        assertEquals("username", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SOURCE_TOPICS_POLICY_PDP_PAP1 + "userName"));
+        assertEquals("password", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SOURCE_TOPICS_POLICY_PDP_PAP1 + "password"));
+        assertEquals("true", topicProperties.getProperty(
+            CommonTestData.TOPIC_INFRA + SOURCE_TOPICS_POLICY_PDP_PAP1 + "allowSelfSignedCerts"));
+    }
 }
