# AzureServiceBusTopicResource

- Module: [Aspire.Hosting.Azure.ServiceBus](/reference/api/go/aspire.hosting.azure.servicebus.md)
- Version: `17.0.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Represents a Service Bus Topic. Initializes a new instance of the `AzureServiceBusTopicResource` class.

## Definition

```go
type AzureServiceBusTopicResource interface {
    ExpressionValue
    Resource
    ResourceWithConnectionString
    ResourceWithParent
}
```

## Embeds

- `ExpressionValue`
- `Resource`
- `ResourceWithConnectionString`
- `ResourceWithParent`

## Properties

- `ConnectionStringExpression`: `*ReferenceExpression` `get` -- Gets the connection string expression for the Azure Service Bus Topic.
- `DefaultMessageTimeToLive`: `*float64` `get/set` -- ISO 8601 default message timespan to live value. This is the duration after which the message expires, starting from when the message is sent to Service Bus. This is the default value used when TimeToLive is not set on a message itself.
- `DuplicateDetectionHistoryTimeWindow`: `*float64` `get/set` -- ISO 8601 timeSpan structure that defines the duration of the duplicate detection history. The default value is 10 minutes.
- `Parent`: [`AzureServiceBusResource`](/reference/api/go/aspire.hosting.azure.servicebus/azureservicebusresource.md) `get` -- Gets the parent Azure Service Bus resource.
- `RequiresDuplicateDetection`: `*bool` `get/set` -- A value indicating if this topic requires duplicate detection.
- `ResourceTypeDisplayName`: `string` `get` -- Gets the ResourceTypeDisplayName property
- `TopicName`: `string` `get/set` -- The topic name.

## Methods

- [AddServiceBusSubscription](/reference/api/go/aspire.hosting.azure.servicebus/azureservicebustopicresource/addservicebussubscription.md) -- `method` -- Adds an Azure Service Bus Subscription resource to the application model.
  ```go
  AddServiceBusSubscription(name string, options ...*AddServiceBusSubscriptionOptions) AzureServiceBusSubscriptionResource
  ```
- [WithProperties](/reference/api/go/aspire.hosting.azure.servicebus/azureservicebustopicresource/withproperties.md) -- `method` -- Allows setting the properties of an Azure Service Bus Topic resource.
  ```go
  WithProperties(configure func(obj AzureServiceBusTopicResource)) AzureServiceBusTopicResource
  ```
