# Different message types with same unqualified name

**URL:** <https://forums.foundationdb.org/t/different-message-types-with-same-unqualified-name/4400>\
**Category:** Record Layer\
**Created:** [March 23, 2024, 6:22pm UTC](https://forums.foundationdb.org/t/different-message-types-with-same-unqualified-name/4400 "2024-03-23T18:22:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stacktracer](https://sea1.discourse-cdn.com/foundationdb/user_avatar/forums.foundationdb.org/stacktracer/32/1757_2.png) [@stacktracer](https://forums.foundationdb.org/u/stacktracer)\
**Post date:** [March 23, 2024, 6:22pm UTC](https://forums.foundationdb.org/t/different-message-types-with-same-unqualified-name/4400/1 "2024-03-23T18:22:34Z")

</div>

Is there any way to use Record Layer with protobuf message types that are in different protobuf packages, but have the same unqualified message name? For example:

```auto
message MyUnion {
  option (com.apple.foundationdb.record.record).usage = UNION;
  v1.MyRecord _record_v1 = 1;
  v2.MyRecord _record_v2 = 2;
}

```

I think the answer is no – afaict the Record Layer code assumes message types will have distinct unqualified names, so `v1.MyRecord` and `v2.MyRecord` would collide. But I want to be sure I’m not missing something.

---

<div class="post-metadata">

**Author:** ![MMcM](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@MMcM](https://forums.foundationdb.org/u/MMcM)\
**Post date:** [March 25, 2024, 4:27pm UTC](https://forums.foundationdb.org/t/different-message-types-with-same-unqualified-name/4400/2 "2024-03-25T16:27:17Z")

</div>

That is correct. There is no support for this today.

However, it is not fundamental to the data model. Record types have their own names. The limitation is how those are specified / initialized by the file descriptor.

I suspect that if `RecordMetaDataBuilder.processRecordType`, where it inits a new `RecordTypeBuilder`, honored an additional `RecordTypeOptions` field in the message descriptor to give a name, most everything would just work.
